Commit graph

926 commits

Author SHA1 Message Date
Pāvels Nadtočajevs
4310cb82b8
AccessKit integration for macOS, Linux, and Windows. 2025-04-08 20:25:47 +03:00
Riteo
84d3adcf2f Wayland: Implement native sub-windows
The backend is now mature enough to not explode with multiple windows
but the `DisplayServer` API still cannot meet some guarantees required
by the various Wayland protocols we use. To meet those guarantees this
patch adds three new elements to the DisplayServer API, with relative
handling logic for `Window` and `Popup` nodes:

 - `WINDOW_EVENT_FORCE_CLOSE`, which tells a window to *forcefully*
close itself and ensure a proper cleanup of its references, as Wayland
enforces this behavior;

 - `WINDOW_FLAG_POPUP_WM_HINT`, which explicitly declares a window as a
"popup", as Wayland enforces this distinction and heuristics are not
reliable enough;

 - `FEATURE_SELF_FITTING_WINDOWS`, which signals that the compositor can
fit windows to the screen automatically and that nodes should not do
that themselves.

Given the size of this feature, this patch also includes various
`WaylandThread` reworks and fixes including:

 - Improvements to frame wait logic, with fixes to various stalls and a
configurable (through a `#define`) timeout amount;

 - A proper implementation of `window_can_draw`;

 - Complete overhaul of pointer and tablet handling. Now everything is
always accumulated and handled only on each respective `frame` event.
This makes their logic simpler and more robust.

 - Better handling of pointer leaving and pointer enter/exit event
sending;

 - Keyboard focus tracking;

 - More solid window references using IDs instead of raw pointers as
windows can be deleted at any time;

 - More aggressive messaging to window nodes to enforce rects imposed by
the compositor.
2025-04-04 20:23:25 +02:00
Pāvels Nadtočajevs
52009b52d2
Detect KDE/LXQt and swap OK/Cancel buttons to Windows style. 2025-04-03 12:47:11 +03:00
Thaddeus Crews
1f56d96cf2
Merge pull request #104893 from Repiteo/scons/external-includes-alt
SCons: Add `CPPEXTPATH` for external includes
2025-04-02 07:48:03 -05:00
Thaddeus Crews
f25fc34439
SCons: Add CPPEXTPATH for external includes 2025-04-02 07:29:08 -05:00
Yufeng Ying
4f4031a675 Replace size() == 0 with is_empty(). 2025-04-02 19:18:43 +08:00
Pāvels Nadtočajevs
4638ade13f
Enable TTS on demand, instead of fully disabling it when project setting is not set. 2025-04-01 15:24:46 +03:00
Thaddeus Crews
abd565eb19
Merge pull request #104844 from Ivorforce/gdsoftclass
Add and require `GDSOFTCLASS` for `Object` subclasses that want to cast but do not use `GDCLASS`.
2025-03-31 19:02:03 -05:00
Lukas Tenbrink
fa0a3c9c6e Add and require GDSOFTCLASS for Object subclasses that want to cast but do not use GDCLASS. 2025-03-31 20:49:50 +02:00
Kiro
23129a66ed Replace append_utfx with direct String::utfx 2025-03-30 19:56:38 +02:00
Lukas Tenbrink
ffa6ef220b Use append_ instead of parse_ for String methods. 2025-03-27 17:51:02 +01:00
Thaddeus Crews
d35e22ff22
Merge pull request #104415 from zlago/patch-1
Export: Change unportable `echo` in the Linux/macOS debug launcher script
2025-03-24 10:00:57 -05:00
Thaddeus Crews
f09ee0171a
Style: Begin integrating simple .clangd fixes 2025-03-22 13:24:35 -05:00
zlago
7e0ede1a16 change unportable echo in the linux/macos debug launcher script
`-n` and `-e` are not guaranteed to be supported by posix `echo`
2025-03-21 17:31:37 +01:00
Micky
5d794f83ed Tweak a few miscellaneous localization strings 2025-03-20 13:12:44 +01:00
Pāvels Nadtočajevs
f6891b0305
[DisplayServer] Decouple show_window(MAIN_WINDOW_ID) from DisplayServer constructor, update project manager size/position after DS init. 2025-03-19 11:23:04 +02:00
Thaddeus Crews
49fcd4ce46
Merge pull request #101546 from bruvzg/portal_color_picker
[Linux] Implement native color picker.
2025-03-17 10:52:29 -05:00
Pāvels Nadtočajevs
18f6c33d72
[DisplayServer] Implement get_accent_color on Linux. 2025-03-14 09:05:03 +02:00
Rémi Verschelde
28451c001a
Merge pull request #103815 from bruvzg/x11_fd_cond
[X11] Fix native dialog parent selection condition.
2025-03-14 00:08:45 +01:00
Aaron Franke
97ee05e9b7
Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp 2025-03-12 11:11:38 -07:00
Thaddeus Crews
991d01fb52
Merge pull request #103891 from shahriarlabib000/update_readme
Update logo/run icon path in platform READMEs
2025-03-10 21:05:55 -05:00
A Thousand Ships
331a43a9d8
Add String::remove_char(s) methods for performance and convenience 2025-03-10 13:19:28 +01:00
shahriarlabib000
25a8b808d3 update logo/run icon path in README 2025-03-10 12:03:41 +06:00
A Thousand Ships
466590d0ec
Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
Pāvels Nadtočajevs
fe38504aa0 [X11] Fix native dialog parent selection condition. 2025-03-08 16:28:25 +02:00
Thaddeus Crews
324512e11c
Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
Thaddeus Crews
3d9b37911d
Merge pull request #103011 from Repiteo/style/svgo-newline
Style: Ensure svgs have trailing newlines
2025-03-07 15:12:41 -06:00
Thaddeus Crews
c937b6d180
Merge pull request #102419 from Ivorforce/std-size
Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase.
2025-03-07 15:12:25 -06:00
Thaddeus Crews
d9125ebebe
Merge pull request #101293 from Ivorforce/string-to-pointer-conversion
Remove implicit conversions from `String`, `Char16String` and `CharString` to data pointers.
2025-03-07 15:12:12 -06:00
Thaddeus Crews
dadfcd1ff2
Merge pull request #95776 from Calinou/crash-handler-linuxbsd-simplify-file-path
Simplify the printed file paths in the Linux/*BSD crash handler
2025-03-07 15:12:10 -06:00
bruvzg
3e4e6e6c0c Improve native file dialog parent window selection. 2025-03-06 17:15:39 +02:00
Thaddeus Crews
1f2d135444
Merge pull request #103526 from jamie-pate/fix_103522
Fix check for is_maximized in x11 to require both horizontal and vert
2025-03-05 12:07:41 -06:00
Pāvels Nadtočajevs
6ed12bfc5d [Linux/BSD] Offload RenderingDevice creation test to subprocess. 2025-03-04 13:18:26 +02:00
Jamie Pate
4f14f722b8 Fix check for is_maximized in x11 to require both horizontal and vertical
Fixes #103522

Persistent window state doesn't work if your window is 'tiled' in X11
gnome

3.x checks for `horz && vert`
4396e98834/platform/x11/os_x11.cpp (L1708)

4.x also checked `horz && vert` until this change where it was switched
to `horz || vert`
524f061c01 (diff-05f85bc3bf96d384f6b96260c758e63e10bbdd52b04f8ccb34649372e7bc1f48R1382)

The corrected logic is:
Check `horz && vert` for 'is_maximized'
Check `horz || vert` for 'can_maximize'
2025-03-03 15:45:21 -08:00
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
Thaddeus Crews
7e5baa0426
Style: Enforce trailing newlines on svgs 2025-02-18 11:02:45 -06: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
Lukas Tenbrink
e34f1f504c Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase. 2025-02-07 14:57:48 +01: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