Commit graph

124 commits

Author SHA1 Message Date
Rémi Verschelde
a8a1009468 Merge pull request #102641 from Riteo/modifying-spacetime-itself
Wayland: Unstuck keys with same keycode
2025-02-11 23:59:12 +01:00
Riteo
54755a27e9 Wayland: Unstuck keys with same keycode
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.
2025-02-11 13:16:16 +01:00
Rémi Verschelde
e912241f4d Merge pull request #102674 from Riteo/waiting-for-frame
Wayland: Fix engine stalls while waiting frames
2025-02-11 10:54:28 +01:00
Riteo
cbd68eb403 Wayland: Fix engine stalls wihle waiting frames
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.
2025-02-11 01:33:36 +01:00
Rémi Verschelde
19a30bb723 Wayland: Fix build config with so_wrap disabled
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.
2025-02-10 21:42:25 +01:00
Adam Scott
1376828ef6
Fix fr+oss layout issues with KP period
Co-authored-by: Riteo Siuga <riteo@posteo.net>
2025-02-08 17:17:11 -05:00
Adam Scott
e34e127062
Add XK_KP_{Decimal,Enter} to KeyMappingX11::is_sym_numpad() 2025-02-05 10:54:46 -05:00
Thaddeus Crews
480843cf2b
Merge pull request #101812 from bruvzg/portal_chk
[FreeDesktop portal] Check for `FileChooser` and `Settings` interface availability instead of assuming it's always available.
2025-02-03 08:16:10 -06:00
Thaddeus Crews
d2995dcfe8
Merge pull request #102169 from Riteo/what-is-even-a-keypad
Linux/BSD: Modify only keypad keys
2025-02-03 08:16:08 -06:00
Riteo
140a63be25 Linux/BSD: Modify only keypad keys
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.
2025-02-02 19:19:15 +01:00
Thaddeus Crews
4f3dddbbff
Merge pull request #101987 from Riteo/imagine-using-rids
Wayland: Check custom cursor resource reference for cache invalidation
2025-01-31 09:15:52 -06:00
Pāvels Nadtočajevs
86f56efbaa [FreeDesktop portal] Check for FileChooser and Settings interface availability instead of assuming it's always available. 2025-01-31 07:52:40 +02:00
Adam Scott
47f553ae0b
Delegate to the DisplayServer the task of handling mouse_mode
- Add `MOUSE_MODE_MAX` and various index checks
2025-01-28 11:22:27 -05:00
Riteo
c8087567c9 Wayland: Check custom cursor resource reference for cache invalidation
Images don't have RIDs and this way of checking stuff broke the cursor
cache. Let's do like all other platforms and check the resource
reference instead.
2025-01-24 15:10:46 +01:00
Thaddeus Crews
f1c0b5b854
Merge pull request #101779 from Riteo/primary-mess
Wayland: Check selection devices before using them
2025-01-22 09:19:30 -06:00
Riteo
d12137bdda Wayland: Pass unmodified symbols to key events
Before this change we would internationalize the keycode itself in all
`InputEventKey`s, confusing the whole input subsystem.
2025-01-20 18:27:04 +01:00
Riteo Siuga
bed2a1927f Wayland: Check selection devices before using them
Looks like we never actually stopped the code from using bad pointers.
I even forgot the check in the primary selection code 🤦
2025-01-20 02:13:45 +01:00
Riteo Siuga
368a59e6f9 Wayland: Release pressed events on application focus out
Looks like I always assumed wrongly that the compositor would send us
key release events when unfocusing... It did not.
2025-01-20 01:38:25 +01:00
Pāvels Nadtočajevs
133ea4f17a [Wayland] Fix excessive IME updates. 2025-01-17 15:29:06 +02:00
Thaddeus Crews
fd88acc671
Merge pull request #101008 from Repiteo/scons/nocache-all-text
SCons: Properly `NoCache` all text files
2025-01-16 17:17:59 -06:00
Thaddeus Crews
73278bf35d
SCons: Properly NoCache all text files 2025-01-16 16:59:12 -06:00
Travis Lange
d713a22f2e fix wayland can set mode exclusive full screen 2025-01-14 20:21:52 -05:00
Pāvels Nadtočajevs
2e99d84e87 [DisplayServer] Add missing FEATURE_WINDOW_DRAG flag to Windows, X11 and Wayland display servers. 2025-01-14 15:26:32 +02:00
Riteo
e5ac45e822 Wayland: Unsuspend only for the same reason as suspension
Before, we would check both methods together, leading to loops.

Now we track the actual reason we suspended and only unsuspend when
that same reason triggers. For example, if we suspend because of the
suspended flag we'll unsuspend only because it got unset. Conversely, if
we suspend because of a timeout we'll unsuspend only if we get a new
frame event.

We do this because, while some compositors properly report a "suspended"
state (hinting us to stop repainting), most don't and we need a "safety
net" anyways as we do not want to constantly stay at 1fps (the max time
we'll wait before giving up) either.
2025-01-08 13:53:01 +01:00
Pāvels Nadtočajevs
7f0b4e58b0 Implement DisplayServer.window_start_resize. 2025-01-07 07:58:02 +02:00
Rémi Verschelde
44f871ff72
Merge pull request #100898 from Summersay415/wayland-issue
Fix exclusive fullscreen on Wayland
2025-01-06 22:47:53 +01:00
Pāvels Nadtočajevs
e1f129cb52 Support MIME types in file dialog filters on macOS and Linux. 2025-01-04 22:05:35 +02:00
Rémi Verschelde
35cf29bb21
Merge pull request #100715 from buresu/fix-wayland-ime-input
Fix last character deletion in Wayland IME input
2025-01-03 00:48:55 +01:00
Summersay415
8c1742c957 Fix exclusive fullscreen on Wayland 2025-01-02 21:49:49 +07:00
A Thousand Ships
a1846b27ea
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
Naoto Kondo
b719eed725 Fix last character deletion in Wayland IME input 2024-12-22 05:52:03 +09:00
Rémi Verschelde
13274842a9
Merge pull request #100638 from Tiktalik/fixed-wayland-horizontal-scroll
Fix Wayland left/right scroll wheel issues.
2024-12-20 23:57:16 +01:00
Tiktalik
fb741715c1
Fixed incorrect use of vertical scroll where it should have been horizontal. 2024-12-20 00:53:10 -07:00
Hilderin
9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 -05:00
Pāvels Nadtočajevs
293be04ec8 Implement window_start_drag on Windows and Linux. 2024-12-17 16:49:27 +02:00
Thaddeus Crews
38775731e8
Merge pull request #99965 from Riteo/unstable-galore
Wayland: Add support for xdg-foreign-unstable-v2
2024-12-11 17:36:07 -06:00
Thaddeus Crews
f222cc43f3
Merge pull request #99633 from buresu/fix-wayland-keymapping
Fix underscore input not working with jp106 keyboard on wayland platform
2024-12-10 14:15:51 -06:00
Riteo
65c28ed31d Wayland: Add support for xdg-foreign-unstable-v2
The v1 version is deprecated and bound to be removed in the future from
all compositors. This patch adds a v1/v2 designator to everything
related to the protocol and prefers the v2 protocol if both are
available.

Additionally, renames the event handler to follow the Wayland interface
name, for consistency with the rest of the codebase.
2024-12-10 01:29:46 +01:00
MBCX
6bc80effbb Make Godot compile on FreeBSD 2024-12-05 12:33:55 -04:00
Pāvels Nadtočajevs
84650f2018 Implement DisplayServer.beep. 2024-12-03 12:43:26 +02:00
Naoto Kondo
f367a6c231 Fix underscore input not working with jp106 keyboard on wayland platform 2024-11-30 23:40:42 +09:00
Trevor Davenport
0d9a705e25 Wayland: Only set selection when there is not already a source.
Co-authored-by: Riteo Siuga <riteo@posteo.net>
2024-11-17 16:00:24 -07:00
Anish Mishra
0dfd18c84b [DisplayServer] Add feature flag for native file dialog access to user/res and options 2024-10-30 14:13:43 +05:30
Summersay415
6d14cd6ff9 Fix fallbacks to OpenGL 2024-10-28 22:57:19 +07:00
Thaddeus Crews
07e759b74a
Merge pull request #97771 from dsnopek/openxr-linux-egl
OpenXR: Add support for Wayland on Linux
2024-10-25 13:04:08 -05:00
Matias N. Goldberg
0818408db5 Fix wrong Wayland path if building with opengl3=no
Godot checks if there's Vulkan or GLES3 support.
If no support is found, it shows an error message.

However the code for this error message is left out when building with
opengl3=no
2024-10-12 20:20:12 -03:00
David Snopek
256699ee31 OpenXR: Add support for Wayland on Linux 2024-10-04 11:44:05 -05:00
Gergely Kis
146ba4106f Move Vulkan includes to a central godot_vulkan.h header
Also fixes Vulkan build problem with recent Clang.
2024-09-29 17:53:18 +02:00
Rémi Verschelde
a4c1804cab
Merge pull request #97483 from akien-mga/clang-format-19.1.0
CI: Update `clang-format` pre-commit hook to 19.1.0
2024-09-26 12:46:04 +02:00
Rémi Verschelde
c92a6c7e27
CI: Update clang-format pre-commit hook to 19.1.0 2024-09-26 11:46:12 +02:00