This fixes once and for all the core issue of different Godot `keycode`s
released from the same raw XKB keycode.
The `InputEventKey` `keycode` value _should_ map to the "unmodified"
key, but unfortunately there's an ambiguity with their encoding for
"special" keys ("delete", "insert", etc.), in witch they ignore their
unicode representation. This means that a key that is special when plain
but a character when modified would never be properly picked up, so we
do indeed change its keycode. As a consequence of this exception, some
Godot keys never receive release events and get "stuck".
This patch adds an extra check through an `HashMap` to "unstuck" keys
that changed while having the same keycode.
I also could not resist simplifying a bit the regular key event
generation method but this makes things more consistent and predictable
IMO.
There were two edge cases in the frame waiting logic (aka manual frame
throttling or emulated vsync) which would cause the editor to stall in
one way or another:
1. Waiting right after starting the editor would cause a deadlock
between both threads until something happened in the Wayland event
queue, in turn unblocking the Wayland thread and kickstartin the whole
thing;
2. Starting the editor (and probably other long-loading stuff) without
low consumption mode would suspend the window and never commit its
surfaces, thus never signaling the compositor that we want frame events.
We should only include the vendored headers for Wayland and libdecor-0 when
we use `so_wrap`, i.e. when we *don't* build against system libraries.
The libdecor-0 pkg-config file includes the `libdecor-0/` prefix already,
so its header should be included without it, and likewise in our so wrappers.
Fixes#102671.
Not my finest work, but without that code removed in #102179, mingw-gcc 14.2.1 on Fedora 41
(but also confirmed with versions on macOS and WSL) crashes when linking with LTO.
We need to dig deeper to understand the bug, report it upstream and work it around in a
cleaner way. But for now this unblocks building Windows binaries with LTO, and should be
harmless.
The AndroidManifest already stores the Godot editor and library versions. The addition of this meta-data allows to identify Godot Android apps that may be subject to renderer specific issues addressed in future versions of the engine.
The `keycode` field of `InputEventKey` is supposed to be "unshifted";
That is, what the key would output if no modifier keys were pressed.
This should match what's written on the key label, but `Key` enumerates
also all keypad keys, which require a modifier. We thus require some
extra checks for them.
Note that this can still allow "stuck keys", but that's an even deeper
problem.
Creating a JoypadApple can trigger a notification to add a joypad (if
a device is already connected before the game is started). Observed
on iOS 18.2.1 with a Nimbus SteelSeries.
However at this point the Input singleton is not available yet, so
it will crash.
This commit moves JoypadApple initialization to `initialize_joypad()`
which is called explicitly after the Input singleton is available.
This is consistent with other platform joypad initialization.