Commit graph

887 commits

Author SHA1 Message Date
Hilderin
0c384e7217 Replace error to info messages for embedded game 2025-02-26 19:32:25 -05:00
Pāvels Nadtočajevs
ab717497ef [Windows] Offload RenderingDevice creation test to subprocess. 2025-02-24 19:40:10 +02:00
Pāvels Nadtočajevs
f710781b16 Prevent pending input event callbacks from erasing the window in the middle of a loop. 2025-02-18 15:26:13 +02:00
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
Hilderin
a3d03717c0 Fix Floating Window request close when a dialog is opened 2025-02-05 20:34:32 -05:00
Thaddeus Crews
a63a8b430b
Merge pull request #102104 from Hilderin/fix-embedded-game-disappear-when-not-focused
Fix Embedded Game disappear when not focused on KDE 5
2025-02-05 10:27:38 -06:00
Thaddeus Crews
a2d6e2e138
Merge pull request #102448 from adamscott/a-miserable-little-pile-of-secrets
Add `XK_KP_{Decimal,Enter}` to `KeyMappingX11::is_sym_numpad()`
2025-02-05 10:27:30 -06:00
Adam Scott
e34e127062
Add XK_KP_{Decimal,Enter} to KeyMappingX11::is_sym_numpad() 2025-02-05 10:54:46 -05:00
Hilderin
f7d1558bc0 Fix Embedded Game disappear when not focused on KDE 5
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-02-05 12:01:40 +01:00
Rémi Verschelde
b4e16b4520 Merge pull request #102314 from Hilderin/fix-floating-window-overlapping
Fix Floating Window overlapping when on screen edge on KDE
2025-02-05 11:34:05 +01:00
Rémi Verschelde
ab0c712bf5 Merge pull request #102311 from Hilderin/fix-floating-window-not-visible-after-restore
Fix Floating Window not visible after restore on KDE
2025-02-05 11:34:01 +01: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
Hilderin
bc0efb86a9 Fix Floating Window overlapping when on screen edge 2025-02-01 22:27:57 -05:00
Hilderin
150191353f Fix Floating Window not visible after restore on KDE 2025-02-01 21:08:39 -05: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
Thaddeus Crews
3c80c14092
Merge pull request #101924 from adamscott/game-editor-non-cached-mouse-mode
Delegate handling `mouse_mode` to the `DisplayServer`
2025-01-28 16:08:56 -06: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
Hilderin
725dd4930e Fix BadWindow error when stopping embedded game on Linux 2025-01-25 20:30:40 -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
Hilderin
9eed43d429 Fix NOTIFICATION_WM_CLOSE_REQUEST in Embedded Floating Window 2025-01-21 21:03:15 -05: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
Rémi Verschelde
26db0bb15f SCons: Make lto=auto prefer ThinLTO over full LTO for LLVM targets
This speeds up build time considerably for these platforms compared to
using `lto=full`, which is sadly single-threaded with LLVM, unlike GCC.

Changes to default behavior of `lto=auto` (i.e. `production=yes`):
- Linux: Prefer ThinLTO for LLVM
- Web: Prefer ThinLTO
- Windows: Prefer ThinLTO for llvm-mingw

The following LLVM targets don't use LTO by default currently, which
needs to be assessed further (gains from LLVM LTO on performance need
to be weighed against the potential size increase from heavy inlining):
- Android
- iOS
- macOS
- Windows clang-cl
2025-01-09 13:03:58 +01:00
Rémi Verschelde
65cf7c1d5e Merge pull request #101221 from bruvzg/win_dec_exp
[Window] Expose `start_drag` and `start_resize` methods (for both native and embedded windows).
2025-01-09 11:17:24 +01:00
Rémi Verschelde
7fe0609118 Linux: Relax interdependency between freetype, libpng, and zlib for unvendored builds
This restriction was added to fix #7373 back then, which was a symbol conflict
between FreeType's bundled copy of gzip/zlib, and distro packages.

But we also unbundled FreeType's zlib in #69395 so this is no longer an issue.

On the other hand recent issues pointed out that using system-provided icu4c
or harfbuzz can cause issues (#91401, #100301). We still allow it for now but
raise a warning.
2025-01-09 00:28:46 +01: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
Rémi Verschelde
cecc83d26a Merge pull request #101225 from Summersay415/arch-docs
Update official export templates architecture list in docs
2025-01-08 00:21:07 +01:00
Rémi Verschelde
0fee2724f0 Merge pull request #100751 from YYF233333/force_regex_with_editor
Force build editor with regex module, remove checking code
2025-01-07 23:17:35 +01:00
Pāvels Nadtočajevs
8d911b2554 [Window] Expose start_drag and start_resize methods (for both native and embedded windows). 2025-01-07 23:35:14 +02:00
Summersay415
f6d22da94b Update official export templates architecture list in docs 2025-01-07 20:28:25 +07:00
Yufeng Ying
34d8255947 Force build editor with regex module, remove checking code.
Fix include.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-07 19:43:23 +08:00
Pāvels Nadtočajevs
7f0b4e58b0 Implement DisplayServer.window_start_resize. 2025-01-07 07:58:02 +02:00
Rémi Verschelde
cc32e46360
Merge pull request #101135 from Hilderin/fix-embedding-not-working-intermittently
Fix embedding failing intermittently
2025-01-06 22:49:05 +01: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
Rémi Verschelde
e06cac212b
Merge pull request #99893 from kiroxas/avoidUTF8ParsingWhenNotNecessary
Avoid duplicated `utf8()` calls
2025-01-06 22:47:12 +01:00