Commit graph

3464 commits

Author SHA1 Message Date
Michael Conrad
cc2547a9e9 Fix joystick axis mapping issues with NVIDIA shield. Probably others.
Issues addressed:

a) Axis mappings were including virtual mouse axes on NVIDIA Shield TV.

The virtual mouse axes have the same axis numbers as the normal analog stick numbers. This was completely breaking joypad support on NVIDIA Shield TV.

b) Joypads were being tracked in a List with the index in the list being treated as the Godot device id.

If a device were to be removed, any device later in the list would be shifted, potentially causing future events with the shifted joypads to have incorrect IDs according to the Godot engine.

c) Unnecessary events were being sent to the Godot engine.

A check was added (per Joystick) that will prevent sending events for all axes when only a single axis value changed.
A similar check was added for "HATs".

See #45712
2021-02-09 08:37:22 -05:00
Bastiaan Olij
4946ae16fc Use /Zi and /FS for including debugger symbols on Windows with MSVC 2021-02-09 00:20:42 +11:00
Rémi Verschelde
849c090343
SCons: Fix debug_symbols tests after switch to BoolVariable
Bug introduced in #45679.

Fixes part of #45816.
2021-02-08 08:53:16 +01:00
kobewi
b6e2ad0e7e Cancel event dispatch on error 2021-02-07 21:50:12 +01:00
Rémi Verschelde
54857d7e81
Merge pull request #44949 from m4gr3d/specify_project_ndk_version
Improve the logic to compile for Android
2021-02-05 13:27:37 +01:00
Rémi Verschelde
5e0f3f1fe1
Merge pull request #45705 from Faless/js/4.x_editor_preload
[HTML5] Better editor persistent folders, automatically open zip import popup
2021-02-04 14:53:31 +01:00
Fabio Alessandrelli
95d2102565 [HTML5] Make home path persistent in editor.
We used to only persist specific sub-folder of /home/web_user/ when
running the Web Editor. This resulted in bad UX about default project
creation path etc.
This PR makes the whole folder persistent, move the zip preloading to a
different folder (to avoid persisting it), and automatically prompt the
user to import it if present.
2021-02-03 18:59:54 +01:00
Rémi Verschelde
43ab0edbd2
Merge pull request #45686 from naithar/feature/extend-plugin-params-4.0
[4.0] [iOS] Additional 'linker_flags' plugin parameter
2021-02-03 18:37:42 +01:00
Sergey Minakov
c575fb81cc iOS: Use storyboard as loading screen
If 'Launch Screen' storyboard is present it will be used as loading screen.
2021-02-03 19:53:52 +03:00
Sergey Minakov
9f5265766d [iOS] Additional 'linker_flags' plugin parameter 2021-02-03 18:27:26 +03:00
Sergey Minakov
4fda1ae6b8 [iOS] Remove remote notifications code
Using any remote notification method (even indirectly) causes App Store to trigger APNS warning email.
2021-02-03 15:00:43 +03:00
Rémi Verschelde
db26871210 SCons: Add production=yes option to use production defaults
This is meant for users making custom builds to match the options used on
optimized, official builds.

This enables, on the platforms which support them:
- `use_static_cpp=yes` (portable binaries for Linux and Windows)
- `use_lto=yes` (link time optimizations - note: requires a lot of RAM!)
- `debug_symbols=no` (no debug symbols, smaller binaries)

Also abort when using MSVC with `production=yes`, as:
- It cannot optimize the GDScript VM like GCC or Clang do, leading to
  significant performance drops.
- Its LTO support is unreliable, at least used to trigger crashes last
  we tried it extensively.

All options can still be overridden if specified, and the `dev=yes` option
was changed to also support overrides.
2021-02-03 11:48:17 +01:00
Fabio Alessandrelli
97288f25f4 [HTML5] Fix mouse_mode and fullscreen detection.
The canvas_id is `#`-prefixed to work with emscripten as a CSS selector.
When comparing to an event target ID (e.g. when checking if the canvas
is fullscreen, or is locking the mouse) we need to skip the first char
(the hash).
2021-02-02 20:08:51 +01:00
Rémi Verschelde
9e0bdeb5de
Merge pull request #45665 from naithar/fix/ios-plugin-initialization-4.0
[4.0] [iOS] Earlier plugin initialization
2021-02-02 17:30:20 +01:00
Rémi Verschelde
74091a1974
Merge pull request #45579 from zaevi/add_scons_ext
add search extensions for Scons' path
2021-02-01 20:41:25 +01:00
Rémi Verschelde
0f4e2cd40c
Merge pull request #45630 from akien-mga/linux-enable-udev
Linux: Enable udev support by default
2021-02-01 16:00:34 +01:00
Rémi Verschelde
1ebd66daff
Linux: Build with use_static_cpp=yes by default for x86_64
This enables `-static-libgcc -static-libstdc++` which help make custom Linux
builds more portable (official builds have been using this option for years).

For some obscure reason Ubuntu 18.04 i386 crashes when using the option for
i386 builds, so let's play it safe and enable for x86_64 only for now.
2021-02-01 14:56:35 +01:00
Rémi Verschelde
e8b69fccbe
Linux: Enable udev support by default
This has been enabled for years in official binaries, and users making custom builds
may end up not enabling it unknowingly, so it's best if we default to the same as
what official builds do.

The original reason for having it opt-in was likely the addition of a dependency on
libudev, but that should be fairly ubiquitous by now.
2021-02-01 14:40:15 +01:00
Sergey Minakov
3db04b3bd4 [iOS] Initialize plugins earlier
Initialize iOS plugins before 'Main::setup' call to have access to them in script's '_init' function.
2021-02-01 15:27:10 +03:00
Rémi Verschelde
5525cd85c6
Merge pull request #45315 from RandomShaper/modernize_thread
Modernize Thread
2021-01-31 15:24:56 +01:00
zaevi
befbfecd4d add search extensions for scons' path 2021-01-30 20:13:01 +08:00
Pedro J. Estébanez
99fe462452 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-01-29 12:02:13 +01:00
Marcel Admiraal
fad0cec272 Don't handle BaseException in JavaScript build script 2021-01-28 19:23:49 +00:00
Aaron Franke
e829b7aee4
Unify URI encoding/decoding and add to C#
http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
2021-01-28 07:45:01 -05:00
Rémi Verschelde
69f77e83bf
Merge pull request #45481 from ronchaine/joypad-detection
POSIX systems: go through all event devices, not just event[0-32]
2021-01-27 19:43:34 +01:00
Jari Ronkainen
01c030f9b7 Go through all event devices, not just event[0-32]
There are no guarantees that joypads are in event0-event32
range.  Some devices, such as laptops with detachable keyboards
and wacom can reserve events all the way up to 32.

Some udev rules with e.g. custom controller firmwares may
load the device as /dev/input/eventX, where X is greater than
32.

This patch uses POSIX dirent to enumerate the event devices, so
entries outside 0-32 range are not skipped.
2021-01-27 20:05:31 +02:00
Sergey Minakov
366ce084f4 [iOS] Rework push notification methods usage
Moved AppDelegate push notifications methods implementation to 'GODOT_ENABLE_PUSH_NOTIFICATIONS'
which can be used in plugins to implement APNS plugins.
2021-01-26 18:39:45 +03:00
Rémi Verschelde
de9c9007c2
Merge pull request #45252 from naithar/feature/plugins-migration
[4.0] [iOS] iOS Plugins Migration
2021-01-26 14:53:06 +01:00
Rémi Verschelde
7086d72e13
Merge pull request #45277 from bruvzg/ios_arm64_sim
Add separate `simulator` flag for iOS build, change main library to `xcframework`.
2021-01-26 14:02:16 +01:00
Fabio Alessandrelli
6f64d93664 [HTML5] Builtin HTTP server disable browsers cache
We don't want browsers to cache our temporary exports (since they will
always differ).
2021-01-25 20:15:57 +01:00
Fabio Alessandrelli
4e09453407 [HTML5] Better editor HTML, small refactor.
Side and GDNative libraries are now added by engine.js , the dynlink pre
js had been deleted.
2021-01-25 20:15:57 +01:00
Fabio Alessandrelli
abb8d8e8ca [HTML5] Fix "initial_memory" build option parsing 2021-01-25 17:47:52 +01:00
Rémi Verschelde
d39f6386ce
Merge pull request #45314 from RandomShaper/modernize_rwlock
Modernize RWLock
2021-01-22 14:51:05 +01:00
Pedro J. Estébanez
8ed259b792 Modernize RWLock
- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
2021-01-19 11:53:10 +01:00
Marios Staikopoulos
2a2de2f684 BUGFIX: Fix unintialized cursor_shape on windows display server 2021-01-18 15:52:47 -08:00
Sergey Minakov
6d67827f4e [iOS] Fix embedding of plugin libraries 2021-01-18 19:23:12 +03:00
Fabio Alessandrelli
bab20c6e09 [HTML5] Custom Gamepad library to allow remapping.
No longer use emscripten functions for gamepads, implement them as
library functions in library_godot_display.js instead.
This allows us to do a better job at "guessing" vendorId, productId, OS,
etc. thus allowing us to better find the remapping for the controller.
2021-01-18 12:30:38 +01:00
bruvzg
efd8f27790
[WIP] Add separate simulator flag for iOS build, change main library to xcframework format. 2021-01-18 10:36:14 +02:00
Sergey Minakov
13a6a83b44 [iOS] Remove plugins from modules. 2021-01-17 14:33:39 +03:00
Sergey Minakov
01d513f3ca [iOS] Added support for '.xcframework' in plugins 2021-01-17 14:13:09 +03:00
Sergey Minakov
7990c2c5e8 [Plugins] Rename 'PluginConfig' struct to platform specific name 2021-01-15 17:54:35 +03:00
Rémi Verschelde
af878716f2
CI: Update to clang-format 11 and apply ternary operator changes 2021-01-12 19:32:53 +01:00
Rémi Verschelde
1218441b16
Merge pull request #44514 from madmiraal/split-os-execute
Split OS::execute into two methods
2021-01-12 16:17:04 +01:00
Fabio Alessandrelli
c327f42b0a [HTML5] Reorganize build script.
Simplify helper functions, fix env/sys_env confusion and depends for
externs and pre-js.
2021-01-10 12:24:40 +01:00
Fabio Alessandrelli
33e914b1eb Fix JavaScript platform after MainLoop methods rename. 2021-01-10 12:04:09 +01:00
Marcel Admiraal
2a74b388d0 Split OS::execute into two methods
1. execute(): Executes a command and returns the results.
2. create_process(): Creates a new process and returns the new process' id.
2021-01-09 10:03:23 +00:00
Yuri Roubinsky
785f84f1d1 Removes semicolon typo in display_server_windows 2021-01-06 15:08:51 +03:00
Yuri Roubinsky
d4939aa05f Fix PopupMenu's which are not closed after a recent commit 2021-01-06 14:42:15 +03:00
Fredia Huya-Kouadio
eee213e01a Improve the logic to compile for Android by automatically detecting and setting up the Android NDK if needed. 2021-01-05 15:07:17 -08:00
Rémi Verschelde
9d6df31b84
Merge pull request #44299 from Chaosus/fix_win32_warning
Fixed warning at window closing (WIN32)
2021-01-05 09:00:47 +01:00
Rémi Verschelde
c13bb0b541
Merge pull request #44154 from dsnopek/webxr-master
Add WebXR support (for Godot 4.0)
2021-01-05 00:19:50 +01:00
David Snopek
a54a2d65e1 Add support for WebXR 2021-01-04 17:02:37 -06:00
Rémi Verschelde
3433780c49
Merge pull request #44645 from m4gr3d/update_apk_signing_logic
Update the logic to sign prebuilt Godot Android apks
2021-01-01 22:58:11 +01:00
Fredia Huya-Kouadio
49969de221 Update the logic to sign prebuilt Godot Android apks.
The previously used tool, `jarsigner` has been deprecated in favor of `apksigner` which is bundled with the Android SDK.
The logic is refactored accordingly and a few editor settings have been deprecated in the process as they're no longer necessary.

Note: As a side effect, specifying the Android SDK path is now required. The docs will be updated to reflect that change.
2021-01-01 13:36:27 -08:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Yuri Roubinsky
41efbf8cae Fixed warning at project startup (WIN32) 2021-01-01 18:09:34 +03:00
Yuri Roubinsky
8a2bc6bf58 Fix window restoring after fullscreen again 2020-12-31 16:07:05 +03:00
Rémi Verschelde
72c13c2631
Merge pull request #44638 from m4gr3d/export_format_util_method
Hardcode the export format for the editor 'run' feature
2020-12-30 09:11:31 +01:00
Fredia Huya-Kouadio
de64b783b4 Add utility method to export the project using a preset format and sign parameter. 2020-12-29 09:04:01 -08:00
Rémi Verschelde
09212fba1e
Fix missed renamings from empty() to is_empty()
Those were missed in #44401 or added by later PRs.
2020-12-29 09:55:07 +01:00
Rémi Verschelde
8886a6a45c
Merge pull request #44757 from andrew-softdev/my-bug-fix
Incorrect format specifiers used to display some type data in the Visual Studio debugger
2020-12-28 20:44:15 +01:00
andrew-softdev
679aabea26 Incorrect format specifiers used to display some String/StringName data 2020-12-28 18:46:32 +00:00
Rémi Verschelde
e4c0572385
Merge pull request #44593 from madmiraal/rename-mainloop-methods
Rename MainLoop methods to match Node methods
2020-12-28 14:44:28 +01:00
Marcel Admiraal
5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Rémi Verschelde
719e4b1156
Merge pull request #44619 from bruvzg/m1_dragdrop_4
[4.0] Fix file drag-drop on M1 Macs.
2020-12-23 17:37:42 +01:00
bruvzg
39bcc77d6a
[4.0] Fix file drag-drop on M1 Macs. 2020-12-23 18:00:50 +02:00
Fredia Huya-Kouadio
2d492ff8ba Fix invalid invocation of get_class_loader.
The call was made on a `Godot` instance instead of an `Activity` instance.
2020-12-23 02:08:27 -08:00
Marcel Admiraal
d9e9eb8d04 Rename MainLoop methods to match Node methods 2020-12-22 12:34:57 +00:00
Marcel Admiraal
2df9a8ccad Rename Rect2 and Rect2i clip() to intersection() 2020-12-19 12:59:08 +00:00
Rémi Verschelde
214a22b98e
Merge pull request #44457 from akien-mga/scons-thirdparty-lib-depends
SCons: Add explicit dependencies on thirdparty code in cloned env
2020-12-18 13:40:33 +01:00
Marcel Admiraal
b56a2f34ce Add missing override keywords in os_windows.h 2020-12-18 09:38:09 +00:00
Rémi Verschelde
c7b53c03ae
SCons: Add explicit dependencies on thirdparty code in cloned env
Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
2020-12-18 10:29:34 +01:00
Rémi Verschelde
5332d212f9
Merge pull request #44467 from madmiraal/add-override-keywords
Add missing override keywords to core/os.h derived classes
2020-12-17 23:02:58 +01:00
Marcel Admiraal
fa435a550a Add override keywords to core/os.h derived classes. 2020-12-17 18:02:31 +00:00
Marcel Admiraal
60ddca2545 Remove OS::can_draw() remnants 2020-12-17 16:35:48 +00:00
Rémi Verschelde
ae0399382a
Merge pull request #44433 from akien-mga/scons-fix-platform-opts
SCons: Add only selected platform's opts to env
2020-12-17 09:56:07 +01:00
Rémi Verschelde
fb2465b3c8
Merge pull request #44410 from KoBeWi/project--tools--thisPR
Make tool menu plugins use Callables for callback
2020-12-16 22:04:39 +01:00
kobewi
889f5e44ef Make tool menu plugins use Callables for callback 2020-12-16 20:23:51 +01:00
Rémi Verschelde
0f84d8dc49
SCons: Add only selected platform's opts to env
Otherwise we can get situations where platform-specific opts with the same name
can override each other depending on the order at which platforms are parsed,
as was the case with `use_static_cpp` in Linux/Windows.

Fixes #44304.

This also has the added benefit that the `scons --help` output will now only
include the options which are relevant for the selected (or detected) platform.
2020-12-16 16:31:19 +01:00
Marcel Admiraal
f9b83e90b2 Fix named anonymous struct warning 2020-12-16 07:42:16 +00:00
Rémi Verschelde
2760f5d0b4
Merge pull request #44315 from madmiraal/fix-handles-baseexception
Don't handle BaseException in build scripts
2020-12-12 12:23:07 +01:00
Marcel Admiraal
8ef5e3201c Don't handle BaseException in build scripts 2020-12-12 10:05:42 +00:00
Rémi Verschelde
8020515717
HTML5: Code style cleanup for export code 2020-12-10 13:57:46 +01:00
Rémi Verschelde
37d0d757d6
Merge pull request #40708 from bruvzg/improve_os_locale
Improve `OS::get_locale()` and documentation.
2020-12-10 11:49:00 +01:00
Fabio Alessandrelli
eb2152538c [HTML5] Fix errors when Mic is not allowed. 2020-12-09 17:54:50 +01:00
Fabio Alessandrelli
a28d5e2be7 [HTML5] Improve platform buildsystem.
Check emcc version requirements when building GDNative.
Add more build options (sanitizers, initial memory).
2020-12-09 17:54:50 +01:00
Fabio Alessandrelli
6bc07cf777 [HTML5] Add logo and favicon to editor html. 2020-12-09 17:54:50 +01:00
Rémi Verschelde
114f97ff11
Merge pull request #44128 from KoBeWi/🧹
Cleanup unused engine code
2020-12-09 13:01:50 +01:00
Tomasz Chabora
2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01:00
Fabio Alessandrelli
09a9712a6a Remove unused FileAccessJAndroid. 2020-12-09 10:58:36 +01:00
Rémi Verschelde
e5e1277ecd
Merge pull request #44161 from Faless/fix/fa_buffered_remove
Remove unused FileAccessBuffered
2020-12-09 09:14:14 +01:00
thebestnom
d543917c03 Android: fix mouse capture relative wrong 2020-12-08 23:51:45 +02:00
thebestnom
e7f259c366 Android: Allow Mouse Capture 2020-12-08 22:14:08 +02:00
Rémi Verschelde
90bdba576a
Merge pull request #43742 from qarmin/editor_modules_default_values
Initialize class/struct variables with default values in platform/ and editor/
2020-12-08 15:53:42 +01:00
Rémi Verschelde
efc2104096
Merge pull request #44021 from dakennedyd/personal
Fix implementation of move_to_trash() on Linux
2020-12-07 21:06:10 +01:00
David Kennedy
8b68c6808d Fixes move_to_trash() on Linux
Fixes #42840 OS move_to_trash() on Linux is not compliant with the Freedesktop specification
2020-12-07 16:40:56 -03:00
Rémi Verschelde
e20011b0da
Merge pull request #44076 from Faless/js/4.x_gdnative
[HTML5] Optional GDNative Support
2020-12-07 15:34:33 +01:00
Fabio Alessandrelli
781efc26e0 Remove now unused FileAccessBuffered. 2020-12-06 19:37:11 +01:00
Fabio Alessandrelli
1396c74734 [HTML5] Use regular unix FileAccess implementation. 2020-12-06 19:25:31 +01:00
Fabio Alessandrelli
dd9503dc19 [HTML5] Make GDNative support feature-based.
This is suboptimal as it requires adding an extra compile flag, but
rewriting how feature tags work is beyond the scope of this work.
2020-12-05 01:12:52 +01:00
Fabio Alessandrelli
1e7bd3d08b [HTML5] Allow selecting the export type.
Available types:
- Regular
- GDNative (support dynamic linking and thus GDNative WASM files)
- Threads (uses WebAssembly Threads)
2020-12-05 00:55:11 +01:00
Fabio Alessandrelli
611c4998e8 [HTML5] EditorRunNative works with GDNative.
This "breaks" our loading bar logic (libraries are not counted).
Fixing it is non trivial and probably deserves investigating a different
strategy.
2020-12-05 00:55:07 +01:00
Fabio Alessandrelli
ca34b5e57a [HTML5] GDNative support via SIDE_MODULE.
Working with emscripten >= 2.0.10
2020-12-05 00:52:43 +01:00
Fabio Alessandrelli
1167ab96e9 [HTML5] Add function signatures to JS libraries. 2020-12-04 23:21:33 +01:00
reduz
2787ad65be RenderingServer reorganization 2020-12-04 18:39:46 -03:00
Rémi Verschelde
02d228554b
OSX: Fix tmp .app folder name after #44060 2020-12-04 14:16:49 +01:00
Bastiaan Olij
cf5737acbe Added driving joystick type to windows joystick handling 2020-12-04 23:31:19 +11:00
Rémi Verschelde
328af1db75
Merge pull request #44074 from reduz/reorganize-3d
Reorganize rendering server.
2020-12-04 08:36:31 +01:00
Rémi Verschelde
586a20875d
Merge pull request #44018 from lyubomirv/mingw_use_static_cpp_option
Add 'use_static_cpp' option for MinGW builds
2020-12-03 23:58:57 +01:00
reduz
e93b2242c2 Reorganize rendering server.
-Made RenderingServerScene abstract, allowing reimplementation
-RenderingServerRaster -> RenderingServerDefault, but this class is going away soon.
2020-12-03 19:01:01 -03:00
Lyubomir Vasilev
e52c9c26fc Add 'use_static_cpp' option for MinGW and MSVC builds 2020-12-03 23:46:16 +02:00
alan-w-255
7fa803fa2c
fix android wrong multi-touch pointerid
Fixes #43519.
2020-12-03 13:34:04 +01:00
Rémi Verschelde
707a62783b
OSX: Remove tmp .app folder instead of moving to trash
Fixes #42232.

And fixes memory leak with use of DirAccess, and harmonize the use of
the sanitized pkg name.
2020-12-03 10:07:40 +01:00
Rafał Mikrut
e1811b689b Initialize class/struct variables with default values in platform/ and editor/ 2020-12-02 16:09:11 +01:00
Rémi Verschelde
f1a9de9c59
X11: Include limits.h for LONG_MAX
Fixes #44030.
2020-12-02 15:43:29 +01:00
Fabio Alessandrelli
178546ac3e [HTML5] Fix broken layout on load in HiDPI screens
This was caused by the devicePixelRatio being applied twice, once by the
HTML code, once by the OS code.
More specifically, OS.get_window_size() would return the canvas element
size, while OS.set_window_size() would set the element size to the
specified value times the devicePixelRatio.
Calling OS.set_window_size(OS.get_window_size()) would reapply the
devicePixelRatio every time.
This commit changes the behaviour so that OS.set_window_size() do not
apply the devicePixelRatio to the canvas element size, by it divides the
CSS size instead.
2020-11-30 12:07:20 +01:00
Fabio Alessandrelli
742729ccfe [HTML5] Remove file flags from writeFile in setup.
Flags where deprecated and partly in removed in emscripten 2.0.9.
2020-11-30 12:07:20 +01:00
Rémi Verschelde
a6751e6c58
Merge pull request #41100 from bruvzg/ctl_text_server_interface
[Complex Text Layouts] Implement TextServer interface.
2020-11-28 09:03:15 +01:00
PouleyKetchoupp
6b97901d4d Implement INCR mechanism for Linux clipboard
Allows pasting from x11 clipboard to receive data incrementally, which
is required when handling data size > 256KB.
2020-11-27 10:00:09 -07:00
bruvzg
99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
bruvzg
b9f441e81e
[Complex Text Layouts] Add third-party TextServer dependencies (ICU, HarfBuzz, Graphite). 2020-11-26 13:55:27 +02:00
Rémi Verschelde
a4e04cdd47
Merge pull request #42652 from nekomatata/x11-clipboard-save-targets
Implement SAVE_TARGETS mechanism for Linux clipboard
2020-11-26 09:34:18 +01:00
Rémi Verschelde
09f3053450
SCons: Do not define TYPED_METHOD_BIND on Linux/clang
It's now only needed for MSVC.
2020-11-25 19:27:30 +01:00
Rémi Verschelde
4159baff6c
Merge pull request #42648 from naithar/fix/native_video_view
[iOS] Native video fixes
2020-11-24 10:41:01 +01:00
Rémi Verschelde
617031434f
Merge pull request #43803 from m4gr3d/update_signing_and_zipalign_logic_master
Update gradle build files to automatically perform signing and zipalign tasks for custom builds
2020-11-24 08:39:06 +01:00
Fabio Alessandrelli
4617a7fa9c [HTML5] Run eslint --fix.
Should I write a poem about this whole new world? ;)
2020-11-23 12:15:18 +01:00
Fabio Alessandrelli
c38984d286 [HTML5] Enforce JavaScript style with eslint.
Applies to javascript files inside the platform library folder, the
exposed Engine code, and any javascript files in modules.

Files ending with ".externs.js" will be ignored, you can create a
".eslintignore" file to specify extra files to be ignored.
2020-11-23 12:15:18 +01:00
Fredia Huya-Kouadio
918b218b55 Update gradle build files to automatically perform signing and zipalign tasks for custom builds. 2020-11-22 18:11:54 -08:00
Fabio Alessandrelli
a82f70ea9f [HTML5] Libraries refactor for linting.
Initial work to make liniting easier.

This includes:
- Rename http_request.js to library_godot_http_request.js.
- Rename externs.js to engine.externs.js.
- New library_godot_runtime.js (GodotRuntime) wraps around emscripten
  functions.
- Refactor of XMLHttpRequest handler in engine/preloader.js.
- Few fixes to bugs spotted by early stage linting.
2020-11-21 14:22:40 +01:00
Rémi Verschelde
504efc5f9b
Export: Reorder options for consistency across platforms 2020-11-20 11:17:50 +01:00
Rémi Verschelde
f69339c2c2
Merge pull request #43692 from akien-mga/scons-leave-link-alone
SCons: Remove unnecessary $LINK overrides
2020-11-19 20:43:25 +01:00
Rémi Verschelde
2e4bff1cfe
SCons: Remove unnecessary $LINK overrides
As of SCons 4.0.1, the default value for $LINK is $SMARTLINK, which itself
is a function that will use $CXX as linker for C++:

https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L327-L328
https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L54-L76

So we don't need to manually specify the same value as $CXX for $LINK.
2020-11-19 16:48:03 +01:00
Rémi Verschelde
dbbbb53927
OSX: Fix linking with osxcross for arm64
For some reason the `-target` option on the `LINKFLAGS` was causing a weird
issue where osxcross' clang wrapper would attempt using the system `/bin/ld`
instead of the osxcross version (which is Apple's `ld64`).

The error message would be:
```
/bin/ld: unrecognized option '-dynamic'
```

Also removed from `CCFLAGS` for consistency, it seems to work fine with only
`-mmacosx-version-min`.
2020-11-19 16:32:32 +01:00
Fredia Huya-Kouadio
c4f2d87747 Fix zipalign command name on Windows machines. 2020-11-18 23:30:45 -08:00
Marcel Admiraal
f42284ed07 Add missing javascript semi-colons. 2020-11-17 18:18:46 +00:00
Aaron Franke
02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
Rémi Verschelde
900e5ffdd8
Merge pull request #43595 from mbrlabs/windows-execute-fix
Fixed exit code retrieval of spawned processes on Windows
2020-11-16 22:16:25 +01:00
Rémi Verschelde
484c3d5e27
Merge pull request #43248 from HEAVYPOLY/master
Change android orientations from sensor to user
2020-11-16 22:12:53 +01:00
Marcus Brummer
f0f4220b05 Fixed exit code retrieval of spawned processes on Windows
Use GetExitCodeProcess() on Windows to retrieve the exit code of a process in
OS:excute()
2020-11-16 18:30:33 +01:00
Rémi Verschelde
e5dfb9b25e
Merge pull request #43556 from naithar/feature/pluggable_app_delegates
[4.0] [iOS] Pluggable application delegate
2020-11-16 17:02:16 +01:00
Rémi Verschelde
7610945b4a
Merge pull request #43461 from ccl2of4/fix-linux-joypad-dpad-zeroing
Fix for linux joypad D-pad zeroing
2020-11-16 14:46:43 +01:00
Rémi Verschelde
8d92135091
Merge pull request #43545 from bruvzg/xchangeprop_atoms_check
Add XChangeProperty atoms validity checks.
2020-11-16 08:01:54 +01:00
bruvzg
319bc5ffda
Add XChangeProperty Atoms validity checks. 2020-11-15 22:20:14 +02:00
Sergey Minakov
2d8c311c01 iOS: fix keyboard display 2020-11-15 16:22:57 +03:00
Sergey Minakov
3f7ca1db70 iOS: Implement pluggable application delegate. 2020-11-15 14:26:44 +03:00
Fredia Huya-Kouadio
46cc3233d8 Update the logic to query for the 'scons' command executable path. 2020-11-14 14:36:53 -08:00
Rémi Verschelde
9e7348f788
Merge pull request #43526 from m4gr3d/address_new_custom_build_logic_issues
Address new custom build logic issues
2020-11-14 22:58:16 +01:00
Fredia Huya-Kouadio
5f6a44f0bb Add missing zip alignment step for generated apks. 2020-11-14 13:10:38 -08:00
Fredia Huya-Kouadio
3de720c11d Fix issue causing Export all to fail. 2020-11-14 13:10:38 -08:00
Fredia Huya-Kouadio
3c1a1a760e Clear unneeded assets when generating an apk expansion.
Clean up export wording to account for the different export formats.
2020-11-14 13:07:32 -08:00
bruvzg
f09a37a8d5
Fixes crash if Vulkan presentation surface is not available. 2020-11-14 13:41:13 +02:00
Marcus Brummer
e1b9be4a6b Added the .jks file extension as valid preset for Android keystore files 2020-11-14 00:29:23 +01:00
Fredia Huya-Kouadio
597d9409f3 Remove duplicate Android orientation settings. 2020-11-13 12:20:06 -08:00
bruvzg
fed776c64c
Add X11 Atom validity checks. 2020-11-12 16:10:17 +02:00
Connor Lirot
dd021099ff Fix for linux joypad D-pad zeroing
Some controllers (notably those made by 8bitdo) do not always emit an event to zero out a D-pad axis before flipping direction. For example, when rolling around aggressively the D-pad of an 8bitdo SN30 Pro/Pro+, the following may be observed:

```
ABS_HAT0X : -1
ABS_HAT0Y : -1
ABS_HAT0Y : 0
ABS_HAT0Y : 1
ABS_HAT0X : 1
```

Notable here is that no event for `ABS_HAT0X: 0` is emitted between the events for `ABS_HAT0X: -1` and `ABS_HAT0X: 1`. Consequently, the game engine believes that both the negative _and_ positive x-axis directions of the D-pad are activated simultaneously (i.e `is_joy_button_pressed()` returns `true` for both `JOY_BUTTON_DPAD_LEFT` and `JOY_BUTTON_DPAD_RIGHT`), which should be impossible.

This issue is _not_ reproducible on all controllers. The Xbox One controller in particular will not exhibit this problem (it always emits zeroing out events for an axis before flipping direction).

The fix is to always zero out the opposite direction on the D-pad axis in question when processing an event with a nonzero value. This unfortunately wastes a small number of CPU cycles on controllers that behave nicely.

**I have verified this issue is also reproducible in the stable 3.2 branch**
2020-11-11 13:54:46 -06:00
Rémi Verschelde
10fd107599
Merge pull request #43443 from Faless/js/4.0_audio_worklet
[HTML5] Port inline JS code to libraries, AudioWorklet support.
2020-11-11 10:07:28 +01:00
Fabio Alessandrelli
179ec3ca0e [HTML5] AudioWorklet API implementation.
Rewrote AudioDriverJavaScript to support multiple processor nodes.
The old (and deprecated) ScriptProcessorNode when threads are not
available, and the new AudioWorklet API when threads are enabled.

The new implementation uses two ring buffers and a shared state to
communicated with the AudioWorklet thread.

The audio.worklet.js JavaScript file is always added to the export
template, but only really used (and downloaded) in the thread build.
2020-11-10 18:56:21 +01:00
Sergey Minakov
1f2f477e1e iOS Export: support multi-target plugin
Plugins can use 'binary_name.a' or 'binary_name.release.a' and 'binary_name.debug.a' for plugin library.
2020-11-10 16:40:06 +03:00
Sergey Minakov
1f94a59859 iOS Export: export modification to support plugins
Added plugin configuration.
Export options now use plugins that could be enabled/disabled.
Plugin changes are observed at runtime.
2020-11-10 16:40:01 +03:00
Sergey Minakov
70f492082e iOS: change platform code to support plugins 2020-11-10 16:28:36 +03:00
Sergey Minakov
30783d57cc iOS Modules: separate main platform code from modules
Moved previously builtin modules 'GameCenter', 'AppStore', 'iCloud' to separate modules to be represented as plugin.
Modified 'ARKit' and 'Camera' to not be builtin into engine and work as plugin.
Changed platform code so it's not affected by the move.
Modified Xcode project file to remove parameters that doesn't make any effect.
Added basic '.gdip' plugin config file.
2020-11-10 16:28:29 +03:00
Fabio Alessandrelli
e2083871eb [HTML5] Port JavaScript inline code to libraries.
The API is implemented in javascript, and generates C functions that can
be called from godot.
This allows much cleaner code replacing all `EM_ASM` calls in our C++
code with plain C function calls.
This also gets rid of few hacks and comes with few optimizations (e.g.
custom cursor shapes should be much faster now).
2020-11-10 11:42:51 +01:00
Fabio Alessandrelli
54cda5c3b8 [HTML5] Update syntax for lto. 2020-11-10 11:42:51 +01:00
Rémi Verschelde
827e5b8bf3
Merge pull request #43412 from akien-mga/variant-rename-_RID-to-RID
Variant: Rename Type::_RID to Type::RID
2020-11-09 17:46:34 +01:00
Rémi Verschelde
9d2e8f2f27
Variant: Rename Type::_RID to Type::RID
The underscore prefix was used to avoid the conflict between the `RID` class
name and the matching enum value in `Variant::Type`.

This can be fixed differently by prefixing uses of the `RID` class in `Variant`
with the scope resolution operator, as done already for `AABB`.
2020-11-09 16:29:04 +01:00
Hugo Locurcio
ff1f0d2cb5
Remove debug_symbols=full in favor of debug_symbols=yes
`debug_symbols=yes` will now behave like `debug_symbols=full` did
before. The difference in compressed file sizes is not that large,
which means there isn't much point in having two different values.

This helps make the buildsystem easier to understand.
2020-11-09 15:48:30 +01:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Fabio Alessandrelli
b3453e866b [HTML5] Fix audio buffer size and latency hint.
The size of the audio buffer was incorrectly doubled when creating the
script processor.
latencyHint is expressed in seconds, not milliseconds.
Additionally, on some browsers it actually affect the performance and
stability of the audio driver.
For this reason it has been completely disabled (interactive) and a not
has been left for future reference.
2020-11-06 15:38:47 +01:00
Rémi Verschelde
df2abc55be
Merge pull request #43353 from madmiraal/fix-43352
Use LONG instead of DWORD (unsigned int) when interacting with DIJOFS constants
2020-11-06 12:46:36 +01:00
unknown
4a6e53b3c9 Use LONG instead of DWORD (unsigned int) when interacting with DIJOFS constants. 2020-11-06 10:17:28 +00:00
Rémi Verschelde
1abe52e611
Merge pull request #43051 from Ev1lbl0w/bugfix-path-inconsistency
Changed path behaviour for Windows
2020-11-06 10:18:21 +01:00
Vaughan Ling
d658063833 Change android orientations from sensor to user
# Conflicts:
#	platform/android/java/lib/src/org/godotengine/godot/GodotIO.java
2020-10-31 17:14:32 -07:00
bruvzg
4efcec3545
[iOS] Add missing ARC flag to the simulator build. 2020-10-30 18:47:42 +02:00
Rémi Verschelde
41f66761fd
Merge pull request #37158 from thebestnom/android-click-support
Support mouse events on Android
2020-10-30 16:00:03 +01:00
Fredia Huya-Kouadio
edf762fba6 Add a separate nativeSrcsConfigs module to handle Android Studio constraints for native code editor support. 2020-10-29 00:01:14 -07:00
Fredia Huya-Kouadio
aff7cf4390 Update the gradle plugins 2020-10-28 23:59:33 -07:00
Rémi Verschelde
2eaedcf14e
Merge pull request #42361 from akien-mga/vulkan-layers-opt-in
Vulkan: Make validation layers optional
2020-10-28 21:43:22 +01:00
Rémi Verschelde
45da7d579a
Merge pull request #43153 from nekomatata/android-build-version-close
Release .build_version file handle in Android custom build export
2020-10-28 10:03:18 +01:00
Rémi Verschelde
765b0a0f31
Merge pull request #43053 from Ev1lbl0w/bugfix-shell-open
Changed shell_open behaviour
2020-10-28 09:17:57 +01:00
PouleyKetchoupp
b271315bac Release .build_version file handle in Android custom build export 2020-10-28 09:07:20 +01:00
Mark Riedesel
96e22bd9fb Implement OS.get_window_safe_area() for Android 2020-10-27 13:14:00 -04:00
Rémi Verschelde
54e6338c9b
Vulkan: Make validation layers optional
They're now disabled by default, and can be enabled with the command line
argument `--vk-layers`.

When enabled, the errors about them being missing are now warnings, as
users were confused and thought this meant Vulkan is broken for them.

Fix crash in `~VulkanContext` when validation layers are disabled (exposed by
this PR since before they could not be disabled without source modification).

Also moved VulkanContext member initializations to header.

Fixes #37102.
2020-10-27 16:19:15 +01:00
Ev1lbl0w
9e57a395cf
Changed shell_open behaviour 2020-10-26 13:26:39 +00:00
Ev1lbl0w
525a5be01d
Changed path behaviour for Windows 2020-10-24 14:14:53 +01:00
Mark Riedesel
5fe902244a Fix android apk contents having mtime 1 month in future
minizip documentation describes tm_mon as expecting the number of months
since January - [0, 11], but the month returned by OS.get_date() is in
the range of [1, 12].
2020-10-23 15:05:48 -04:00
Rémi Verschelde
181082589a
Merge pull request #42772 from bruvzg/macos_inertia
[macOS] Suppress momentum scrolling after key press.
2020-10-20 15:10:56 +02:00
Rémi Verschelde
15ff276fcf
Merge pull request #42853 from naithar/fix/in-app-store-master
[4.0] [iOS] InAppStore fixes
2020-10-20 15:10:15 +02:00
reduz
ee06a70ea6 Refactor MethodBind to use variadic templates
Removed make_binders and the old style generated binders.
2020-10-18 12:28:44 +02:00
Sergey Minakov
21bcf3f793 iOS: fix in app store
Enforce strong reference for SKRequests and delegate objects for transactions to work correctly
2020-10-16 16:14:39 +03:00
Fabio Alessandrelli
c54de7f589 [HTML5] Add JavaScriptToolsEditorPlugin.
A new editor plugin, specific to HTML5, that provide some extra features
needed to make the editor usable on that platform.

For now, it adds a "Download project sources" option in the "Tool" menu,
so the user can download the work done as a zip file (from the browser
storage).
2020-10-14 12:31:20 +02:00
Fabio Alessandrelli
3dfb769115 Add JavaScript editor html file. 2020-10-14 11:20:50 +02:00
Fabio Alessandrelli
ec396c7707 [HTML5] Close IDBFS database on exit.
This should be made available in emscripten in a decent way.
Possibly after unmount, to free the database lock and allow performing
operations on it from javascript after the Emscripten Runtime has
exited.
2020-10-14 11:20:37 +02:00
Fabio Alessandrelli
6769dd64fc [HTML5] Expose request_quit via Engine class.
So it can be called when closure compiler is enabled.
2020-10-14 11:15:24 +02:00
Fabio Alessandrelli
c3b7c5cc2d Increase HTML5 THREADPOOL size.
This fixes a "random" deadlock when quitting the editor.
I still haven't figure out the root cause, but having a bigger seems to
greatly mitigate the issue.
The new pool size (pre-allocated threads) is now 8.
2020-10-14 11:13:12 +02:00
bruvzg
801f0a041f
[macOS] Suppress momentum scrolling after key press or modifier change to prevent unexpected change of action. 2020-10-13 18:58:55 +03:00
PouleyKetchoupp
96e8b904cf Implement SAVE_TARGETS mechanism for Linux clipboard
Allows sending the clipboard content to the clipboard manager on exit to
keep the content when using a clipboard manager that doesn't
automatically makes a backup when copying.

MULTIPLE selection mechanism also had to be implemented, because in this
case, the clipboard manager might request multiple selection targets at
once.

Known use case: Ubuntu with XFCE4
2020-10-09 21:12:56 +02:00
bruvzg
56f3aba7b2
[Windows, MSVC] Correctly set source file encoding. 2020-10-09 13:56:20 +03:00
thebestnom
42513f2f47 Android: Mouse Implementation
Implement mouse
Move touch to inputManager
Change to use android/input.h
2020-10-09 04:14:56 +03:00
Rémi Verschelde
67135f246e
Merge pull request #42647 from nekomatata/x11-unfocus-crash-fix
Fix x11 display server crash when deleting popup window when unfocused
2020-10-08 20:05:06 +02:00
PouleyKetchoupp
48a0d44e67 Fix x11 display server crash when deleting popup window when unfocused
On FocusOut events, the window could be destroyed while propagating
WINDOW_EVENT_FOCUS_OUT event, which causes the WindowData to be
invalidated, and still used for calls to XUnsetICFocus.

This change moves calls to XUnsetICFocus, and also XSetICFocus in
FocusIn events, before propagating the change of focus event to the
engine, to be safe in any case.

Also setting xic member to nullptr after all calls to XDestroyIC to keep
things clean and consistent.

Fixes #42645
2020-10-08 17:22:03 +02:00
unknown
9cb46ed4e7 Fixed an issue in UWP export caused by duplicate entry for extensions in content types file. 2020-10-08 18:44:15 +05:30
Sergey Minakov
6b2483c331 iOS: fix native video
Fixed view not being displayed.
Fixed view orientation change.
2020-10-08 14:30:53 +03:00
Rémi Verschelde
97f116d36b
SCons: Refactor and cleanup warnings definition 2020-10-08 10:58:05 +02:00
Rémi Verschelde
182d6d6f42
SCons: Add windows_subsystem=default, restores original behavior
We want debug builds to have a console and easy stdout redirection by default.
Windows makes reading the stdout/stderr stream from gui applications too cumbersome
(and most users don't know about it, and just wonder why they don't see a thing).
2020-10-06 09:30:46 +02:00
Fabio Alessandrelli
7998745237 [HTML5] Scons now expects "emcc" to be in PATH.
No longer parse emscripten/emsdk config to detect emcc/node paths.
Use WhereIs to find "emcc" and "node", look for "node_modules" in "emcc"
path.
2020-10-04 14:26:44 +02:00
Rémi Verschelde
1ff3e60ee0
Merge pull request #42505 from Faless/js/4.0_audio_threads
[HTML5] Move audio processing to thread when threads are enabled.
2020-10-02 16:25:10 +02:00
Fabio Alessandrelli
a618535628 [HTML5] Run Audio process in thread when available
This should fix some of the audio stuttering issues when the HTML5
export is compiled with threads support.
The API should be ported to AudioWorklet to (hopefully) be perfect.
That though, cannot be backported to 3.2 due to extra restriction of
AudioWorklet (which only runs in SecureContext, and needs a polyfill for
Safari).
2020-10-02 14:28:20 +02:00
Sergey Minakov
6ee74de9ee iOS: Native video refactoring
Moved native video handling to separate view.
2020-10-02 15:05:01 +03:00
Sergey Minakov
3cd1cb53a0 iOS: Refactoring
Enabled ARC for iOS.
Weakify/Strongify macros for objc blocks.
Removed old version checks.
Specific types for ObjC++ modules to exclude unneeded bridging.
Separate DeviceMetrics class for device specific data.
Replaced old/deprecated functionality.
2020-10-02 15:04:51 +03:00
Fabio Alessandrelli
80b34ccee1 Add extra suffix for HTML5 thread builds. 2020-10-02 13:35:03 +02:00
Fabio Alessandrelli
5261e5df85 Add COOP/COEP headers to HTML5 "run" server.
This allow the page to be considered a SecureContext if the address is
localhost (127.0.0.1/::1) and let Firefox (and future Chrome versions)
enable extra features needed for the HTML5 threaded export.
2020-10-02 13:35:03 +02:00
bruvzg
b0152dcac5
Fix screen_get_dpi on macOS for non fractional display scales and restore documentation. 2020-10-01 22:52:20 +03:00
Rémi Verschelde
23ab8ea6f6
Merge pull request #40582 from PoqXert/game-center-4.0
[4.0] iOS Game Center improvements
2020-10-01 13:54:03 +02:00
Sergey Minakov
1d9b6b01db iOS: move touch delay to settings 2020-10-01 12:36:11 +03:00
Rémi Verschelde
cc62eaf7be
Merge pull request #41910 from nekomatata/x11-inputs-lag-fix
Fix issues related to delay when processing events on X11 display server
2020-09-30 16:37:44 +02:00
Rémi Verschelde
aed16c8f84
Merge pull request #42381 from timothyqiu/osx-hidden
Hide special folders in FileDialog for macOS
2020-09-29 11:49:03 +02:00
Rémi Verschelde
4e19e3603b
Merge pull request #41385 from m4gr3d/fix_splash_loading_master
Fix splash screen loading on Android
2020-09-28 20:45:53 +02:00
Rémi Verschelde
e66013a6f1
Merge pull request #42262 from akien-mga/ios-pvrtc-fixes
iOS: Fix multiple issues with PVRTC import, disable ETC1
2020-09-28 10:17:38 +02:00
Rémi Verschelde
0ba4a8ba7b
Merge pull request #42327 from bruvzg/4_mac_captured_fix
[macOS] Fix mouse position in captured mode.
2020-09-28 10:08:05 +02:00
Haoyu Qiu
1998f78679 Hides special folders in FileDialog for macOS 2020-09-28 14:36:21 +08:00
Bartłomiej T. Listwon
317c2b194d Add all headers to VS Project 2020-09-27 18:03:51 +02:00
PouleyKetchoupp
5a0376f969 Fix delay to process clipboard content from Godot in other programs
When pasting clipboard content from Godot to other applications,
multiple SelectionRequest events are sent to Godot in order to access
the data. It could take a long time before the data is ready for the
other app because events were processed one by one on the main thread,
especially when Godot is unfocused and runs at low frequency.

With this change, SelectionRequest events are directly handled on the
separate event polling thread to minimize this delay.

This change also replaces clipboard_get() calls in SelectionRequest with
a direct access to internal_clipboard, since in this case we know Godot
is the owner of the clipboard content and it's not necessary to query
the x server for it.
2020-09-25 16:40:04 +02:00
bruvzg
f4a2eabf42
[macOS] Fix mouse position in captured mode. 2020-09-25 08:55:07 +03:00
PouleyKetchoupp
2c4d64102a Fix general keyboard input lag on X11 display server
This change makes keyboard inputs more responsive on Linux, especially
when the FPS is lower on slower configurations.

Polling events from the x server is done on a separate thread to avoid a
frame delay with inputs, due to first sending the event to the input
manager with XFilterEvent then processing the new event only on the next
frame.

Calls to Input Manager functions like XSetICFocus, XUnsetICFocus and
XSetICValues use a mutex, because they are polling events internally and
would otherwise interfere with our own thread process for polling events
which can cause a deadlock in some cases.

XUnsetICFocus is called instead of XSetICFocus on FocusOut events,
so the input manager can be properly notified of focus changes.

clipboard_get now uses a blocking call to poll for a specific event type
when waiting for a SelectionNotify event, instead of polling all events
and filtering them afterwards.
2020-09-24 16:01:41 +02:00
Vasiliy Makarov
313006adb8 iOS: Fix multiple issues with PVRTC import, disable ETC1
Fixes: #28683, #28621, #28596 and maybe others

For iOS we enable pvrtc feature by default for all backends
Etc1 for iOS doesn't have any sense, so it disabled.
Fixed checks in export editor.
Fixed pvrtc encoding procedure.

Edit by Akien: Forward-ported from #38076, this may not make sense as is for
Godot 4.0, but it's important that we have the latest code in sync with 3.2
for when more rendering backends and proper iOS support are added back.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-09-23 11:22:51 +02:00
Rémi Verschelde
c10e8ac1de
Merge pull request #42178 from Faless/js/sync_fs_size_handlers
[HTML5] Synchronous main, better persistence, handlers fixes, optional full screen.
2020-09-23 10:14:22 +02:00
Fabio Alessandrelli
dccd71c7a3 JS synchronous start, better persistent FS sync.
The engine now expects to emscripten FS to be setup and sync-ed before
main is called. This is exposed via `Module["initFS"]` which also allows
to setup multiple persistence paths (internal use only for now).

Additionally, FS syncing is done **once** for every loop if at least one
file in a persistent path was open for writing and closed, and if the FS
is not syncing already.

This should potentially fix issues reported by users where "autosave"
would not work on the web (never calling `syncfs` because of too many
writes).
2020-09-23 09:51:06 +02:00
Fabio Alessandrelli
53f04aa1b9 Make canvas resize optional in HTML5. 2020-09-23 09:51:06 +02:00
Fabio Alessandrelli
806edcae5b Better HiDPI support in HTML5. 2020-09-23 09:51:06 +02:00
Fabio Alessandrelli
7d0896e763 Window event listener do not use capture. 2020-09-23 09:51:06 +02:00
Fabio Alessandrelli
48aa0b5b03 Small refactor to JavaScript handlers.
Crated helper class in native/utils.js.
Simplify code in OS/DisplayServer.
2020-09-23 09:51:06 +02:00
Fabio Alessandrelli
7d045b8543 Expose request_quit method to JS in HTML5 export. 2020-09-23 09:51:06 +02:00
Fredia Huya-Kouadio
79c1cf600b Add overridable init method for the Godot fragment instance. 2020-09-18 16:59:09 -07:00
Fabio Alessandrelli
27ab97501b [HTML5] Add override keyword, cleanup methods. 2020-09-18 18:48:59 +02:00
Rémi Verschelde
3e78963bb9
Fix typos with codespell
Using codespell 1.17.1.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2020-09-18 13:44:25 +02:00
Rémi Verschelde
413ff7938d
X11: Try to load libXrandr.so.3 if libXrandr.so.2 isn't found
All Linux distros, and FreeBSD and OpenBSD seem to have libXrandr.so.2,
but for some reason recent NetBSD versions seem to have libXrandr.so.3 now.
2020-09-18 11:55:12 +02:00
Rémi Verschelde
5f4d64f4f3
Linux/BSD: Fix support for NetBSD
Add __NetBSD__ to `platform_config.h` so that it can find `alloca`
and use the proper `pthread_setname_np` format.

Rename RANDOM_MAX to avoid conflict with NetBSD stdlib.

Fixes #42145.
2020-09-18 10:27:55 +02:00
bruvzg
6a14c72b12
Add window click-through support. 2020-09-17 12:36:18 +03:00
Hugo Locurcio
4df86f8b04
Only display the Windows toggle console option if it can actually be used 2020-09-14 21:52:04 +02:00
Marcel Admiraal
e3d698dae9 Remove unused Python imports. 2020-09-10 11:38:52 +01:00
Marcel Admiraal
64095245ee Explicitly add implicitly added semicolons. 2020-09-09 15:30:57 +01:00
bruvzg
f043eabdd8
Adds PCK encryption support (using script encryption key for export).
Change default encryption mode from ECB to CFB.
2020-09-05 14:53:39 +03:00
bruvzg
80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Rémi Verschelde
a77106bf7e
Merge pull request #41332 from bruvzg/win_subsys_option
Revert #41164, add subsystem build option.
2020-09-03 11:52:29 +02:00
PouleyKetchoupp
eeebe6914e Fix drag and drop between windows in X11 display server
Proper implementation for get_window_at_screen_position:
Now getting the topmost last active window when overlapping.

Mouse drag & release events:
They are now propagated through the current focused window, in order to
make it consistent with the engine expectations and the Windows display
server implementation.
2020-09-03 10:31:03 +02:00
Rémi Verschelde
2a8531cc56
Merge pull request #41456 from nekomatata/x11-fix-popups
Popup fixes for X11 display server
2020-09-03 00:09:19 +02:00
Fredia Huya-Kouadio
b8d5ced8cd Fix issue causing the textedit to move upward 2020-08-30 10:42:38 -07:00
Rémi Verschelde
c59e9399e7
Merge pull request #41550 from godotengine/revert-40671-virtual-keyboard-height-fix
Revert "Fix virtual keyboard height regression"
2020-08-27 08:55:51 +02:00
Rémi Verschelde
f98b32ff51
Merge pull request #41549 from godotengine/revert-40484-android-virtual-keyboard-adjustment
Revert "Disable virtual keyboard focus adjustment on Android"
2020-08-26 23:48:09 +02:00
Fredia Huya-Kouadio
db35a008f6
Revert "Fix virtual keyboard height regression" 2020-08-26 14:38:02 -07:00
Fredia Huya-Kouadio
ffd0bb1d02
Revert "Disable virtual keyboard focus adjustment on Android" 2020-08-26 13:27:25 -07:00
Fredia Huya-Kouadio
04b402b6f1
Revert "Move PopupWindow logic to GodotEditText on Android" 2020-08-26 13:24:18 -07:00
PouleyKetchoupp
bb306750ce Fix WINDOW_EVENT_FOCUS_IN for popups on Windows
On Windows, WINDOW_EVENT_FOCUS_IN was never sent by the display server
for popups, because WM_ACTIVATE events are received during the call to
_update_window_style, which happened before the callbacks were set.

This was causing some issues with the way Popup is now handling closing on
parent focus.

Now _update_window_style is only called during show_window, after Window
initialized callbacks.
2020-08-26 18:14:36 +02:00
PouleyKetchoupp
5315bff002 Fix menu popups delay and focus in X11 display server
Now using override_redirect for menu & tooltip popups to prevent the WM from
interfering with them, so we have more control over focus management
and avoid a delay before they show up.
2020-08-26 18:14:07 +02:00
bruvzg
9a85948907
[macOS] Fix heap use-after-free in DisplayServer. 2020-08-25 14:04:20 +03:00
PouleyKetchoupp
2b49cb0b73 Re-apply "Fixes for windows in X11 tiling WMs"
From PR #38727 which was reverted in #41373 because of regressions in Ubuntu
with Gnome.

Co-authored-by: Lorenzo Cerqua <lorenzocerqua@tutanota.com>
2020-08-22 18:42:42 +02:00
Marcel Admiraal
5f092cf7bb Fix new black style check failures in various files. 2020-08-21 16:51:30 +01:00
Fredia Huya-Kouadio
2717891141 Fix splash screen loading on Android 2020-08-19 16:16:37 -07:00
Juan Linietsky
9c5c1635b2
Revert "Fixes for windows in X11 tiling WMs" 2020-08-19 12:37:59 -03:00
Rémi Verschelde
5f6368278f
Merge pull request #41080 from naithar/feature/ios-framework-import
[iOS] [4.0] Export: Add a method to embed a framework
2020-08-19 14:10:50 +02:00
Sergey Minakov
1661309d59 iOS Export: Add a method to embed a framework
By default 'add_ios_framework' would not embed a framework to save previous behavior.
New 'add_ios_embedded_framework' would embed framework on export.
2020-08-19 14:35:54 +03:00
bruvzg
c76fe59204
Add Windows Subsystem build option. 2020-08-17 19:07:12 +03:00
bruvzg
03ffd6451a
Revert "[Windows] Attach to parent console instead of creating new one."
This reverts commit 4f7a49db53.
2020-08-17 19:05:48 +03:00
bruvzg
ee76775792
[Windows] Fix modifier keys when using tablet input. 2020-08-17 14:43:16 +03:00
Andrii Doroshenko (Xrayez)
6f426c3360 Port ClassDB tests to use doctest
Extracted the most minimal core initialization functionality from
`setup()` and `setup2()` so that `ClassDB` could be tested properly
(input, audio, rendering, physics etc, are excluded).

Display and rendering servers/singletons are not initialized at all.

Due to the fact that most subsystems are disabled, fixed various crashes in the
process (in order):
- `AcceptDialog` OK/cancel swap behavior (used `DisplayServer` while
  `register_scene_types()`);
- `make_default_theme` which depends on `RenderingServer`;
- `XRServer` singleton access while calling `register_modules_types()`;
- hidden bug in a way joypads are cleaned up (MacOS and Linux only).

Removed manual `ClassDB` init/cleanup calls from `test_validate_testing.h`.

ClassDB tests:

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-08-16 16:41:02 +03:00
Rémi Verschelde
d4665e7859
Merge pull request #41285 from bruvzg/macos_on_top_4
[macOS] Fix "on top" incorrectly set on init and resetting on window update.
2020-08-15 17:59:05 +02:00
bruvzg
9d1cf0b6af
Fix "on top" incorrectly set on init (all platforms).
Fix "on top" reseting on window update. (macOS).
2020-08-15 17:53:18 +03:00
Gordon MacPherson
788c521ce8 fixed linker being slow on OSX 2020-08-15 01:55:36 +01:00
Rémi Verschelde
33b2070d2e Remove obsolete GLES2 backend code
This code currently isn't compiled (and cannot compile).

We plan to re-add OpenGL ES-based renderer(s) in Godot 4.0 alongside Vulkan
(probably ES 3.0, possibly also a low-end ES 2.0), but the code will be quite
different so it's not relevant to keep this old Godot 3.2 code.

The `drivers/gles2` code from the `3.2` branch can be used as a reference for
a potential new implementation.
2020-08-13 10:04:53 +02:00
Rémi Verschelde
7e19f217bd
Merge pull request #41000 from amanj120/forward_port_bundle_pr_export
Add 'Export App Bundle' to Android Export Options
2020-08-11 19:03:40 +02:00
Rémi Verschelde
0e751ea7c3
Merge pull request #41164 from bruvzg/win_attach_console
[Windows] Attach to parent console instead of creating new one.
2020-08-11 12:58:12 +02:00
bruvzg
f797e1c078
Improve OS::get_locale() on macOS and Windows, replace "-" with "_" and use system macros instead of bitwise AND. Add locale format info to the documentation. 2020-08-11 13:19:19 +03:00
bruvzg
4f7a49db53
[Windows] Attach to parent console instead of creating new one. 2020-08-11 13:02:50 +03:00
Rémi Verschelde
f2d6a4bf84
Merge pull request #40961 from BrainBlasted/update-platform-metadata
platform: Update metadata for export platforms
2020-08-11 12:02:20 +02:00
Sergey Minakov
f9989a1a58 iOS: simplify OS value retrieval 2020-08-10 15:54:44 +03:00
Aman Jain
2b89944a3d Add 'Export App Bundle' to Android Export Options 2020-08-05 12:55:02 -04:00
Christopher Davis
41d8c0c818 platform: Update metadata for export platforms
Updates the logos of for macOS, Android, and iOS; Also
changes "Mac OSX" to "macOS"

Addresses https://github.com/godotengine/godot-proposals/issues/1161
2020-08-01 23:43:14 -07:00
Rémi Verschelde
ec9302cecc
Merge pull request #40927 from 27thLiz/dinput-id
DirectInput: Use correct joypad id
2020-08-01 10:13:15 +02:00
Andreas Haas
802a0316c5
DirectInput: use correct joypad id
Previously `joypad_count` was used as the index into the d_joypads array when initializing a new gamepad.
This caused the accidental override of an already connected device when a gamepad with a lower id was disconnected and connected again.

fixes #17566
2020-07-31 20:16:51 +02:00
opl-
a31b164071 Fix losing X11 window normal size hint properties
This was caused by `XSetWMNormalHints` being called multiple times, each time with different values. Calling the method replaces the old data completely, resulting in some of the settings being lost.

Since the method was called 3 times before the window was mapped, this resulted in the position hint being lost and the window always getting opened at a position determined by the WM.
2020-07-31 17:32:46 +02:00
Rémi Verschelde
1cee89467b
Merge pull request #40591 from madmiraal/fix-24526
Update Linux gamepad detection to match SDL.
2020-07-31 13:02:35 +02:00
Rémi Verschelde
35ff38b3d4
Merge pull request #40761 from naithar/feature/ios-safe_area
[iOS] Safe area reimplementation
2020-07-30 00:43:03 +02:00
PouleyKetchoupp
cac7eb3a64 Move PopupWindow logic to GodotEditText on Android 2020-07-28 21:19:17 +02:00
Aman Jain
e906ac4d3b refactor apk signing into it's own method 2020-07-27 14:24:57 -04:00
Sergey Minakov
2e705fd620 iOS: safe area implementation 2020-07-27 17:58:57 +03:00
Rémi Verschelde
6e577a5b80
Merge pull request #40755 from Faless/js/fix_and_cancel_swap
Cancel/OK swap on HTML5 platform, small fixes.
2020-07-27 14:32:48 +02:00
Fabio Alessandrelli
0b286a287c Implement HTML5 cancel/ok button swap on Windows.
Platform is detected on init via the `navigator.platform` string.
2020-07-27 14:17:10 +02:00
Fabio Alessandrelli
3e96ba220e Correctly include <stdlib.h> in javascript main.
Already fixed in 3.2, this header is needed since it's where setenv
is declared and we should not assume it to be already included.
2020-07-27 14:17:10 +02:00
Fabio Alessandrelli
757af6a69f Properly set HTML5 DisplayServer init error value.
Checked in main.cpp, would cause the engine to not load.
2020-07-27 14:17:10 +02:00
Rémi Verschelde
bd9fc75768
Merge pull request #40706 from akien-mga/style-fix-file_format-macos
Fix code format scripts compat with non-GNU Unices
2020-07-27 13:27:56 +02:00
Rémi Verschelde
c71e189efd Style: Fix code format scripts compat with non-GNU Unices
It's too hard to get compatibility between GNU and BSD sed,
so let's just use perl oneliners.

And improve it to also remove trailing tabs, not just spaces.
2020-07-27 13:11:44 +02:00
Rémi Verschelde
6de86946ea
Merge pull request #40671 from nekomatata/virtual-keyboard-height-fix
Fix virtual keyboard height regression
2020-07-27 08:57:19 +02:00
Poq Xert
22f1cf5d73 iOS GameCenter: Add authenticate method
And no longer connect automatically.
2020-07-27 12:18:57 +10:00
bruvzg
a05776e20d
[macOS] Refocus last key window after DisplayServer::alert is closed. 2020-07-26 23:00:49 +03:00
Rémi Verschelde
b19b896e06
Merge pull request #40487 from nekomatata/virtual-keyboard-enter-fixes
Fix Return key events in LineEdit & TextEdit on Android
2020-07-26 20:25:53 +02:00
PouleyKetchoupp
8c05dadcff Fix Return key events in LineEdit & TextEdit on Android
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.

Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.

Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.

Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
2020-07-26 20:06:07 +02:00
Rémi Verschelde
f940e5e000 CI: Install master version of psf/black
Until https://github.com/psf/black/pull/1328 makes it in a stable release,
we have to use the latest from Git.

Apply new style fixes done by latest black.
2020-07-26 19:48:25 +02:00
Rémi Verschelde
3842e8c465
Merge pull request #38727 from Riteo/tiling-wm-issues-tests
Fixes for windows in X11 tiling WMs
2020-07-26 17:41:28 +02:00
Rémi Verschelde
df6f867806
Merge pull request #39624 from naithar/fix/ios-touch-events-master
[4.0] Fix for iOS touch recognition
2020-07-26 15:42:51 +02:00
Sergey Minakov
e6d7e01a72 iOS: added delay gesture recognizer
This gesture recognizer will prevent GodotView from processing unwanted gestures.
Emulates UIScrollView behavior.
Fires delayed touches on significant movement.
2020-07-26 16:05:58 +03:00