1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

220 Commits

Author SHA1 Message Date
Rémi Verschelde
0509500a9f Merge pull request #114081 from deralmas/thirdparty/libdecor/0.2.5
libdecor: Regenerate dynamic wrapper
2025-12-17 13:58:46 +01:00
Dery Almas
bea572fc00 libdecor: Regenerate dynamic wrapper 2025-12-17 13:17:14 +01:00
Riteo
0e21840973 Wayland: Add environment variable to disable libdecor loading
Libdecor has some quirks and depending on the setup it might be useful
to switch to the xdg-shell branch. Recompiling the whole engine without
libdecor is not an acceptable way to do that.
2025-12-16 19:12:49 +01:00
Rémi Verschelde
3e2f769ddf Merge pull request #113947 from deralmas/wl-misc-fixes/cleanup-forgor
Wayland: Add missing destroy calls for text input and tablet
2025-12-16 11:26:53 +01:00
Rémi Verschelde
d84a8a63fa Merge pull request #113946 from deralmas/wl-misc-fixes/mfw-mutating-a-copy
Wayland: Fix accidental copy during global remove
2025-12-16 11:26:47 +01:00
Rémi Verschelde
5d5db072f3 Merge pull request #113656 from deralmas/gray-goo-scenario
Wayland: Work around window scale ambiguity
2025-12-16 11:26:42 +01:00
Rémi Verschelde
61b5f80a50 Merge pull request #113256 from deralmas/wl-keyboard-stuff
Wayland: Misc keyboard touchups
2025-12-16 11:26:31 +01:00
Thaddeus Crews
206f1b5a7c Merge pull request #113977 from deralmas/wl-misc-fixes/shhhhh
Wayland: Silence `window_get_wl_surface` on invalid window
2025-12-15 08:01:05 -06:00
Dery Almas
874dd28d66 Wayland: Silence window_get_wl_surface on invalid window
Makes it more consistent with the rest of the `WaylandThread` methods
(so that we can silently check for the window's existence).

Fixes errors when trying to capture the pointer when no surface has been
pointed yet (its logic assumed that this method was silent).

We double-check everywhere anyway but I added it in some places where we
can't either guarantee that it'll check (to avoid segfaults) or that
would be useful to report directly.
2025-12-13 10:10:29 +01:00
Dery Almas
1d1cd7cc1a Wayland: Add missing destroy calls for text input and tablet
Thank you Kiisu_Master for finding this!
2025-12-12 19:22:19 +01:00
Dery Almas
b439a71db3 Wayland: Fix accidental copy during global remove
We were accidentally mutating a copy during cleanup of the viewporter
and fractional scale manager.

Thank you Aaron Franke for finding this out :D
2025-12-12 19:06:29 +01:00
Pāvels Nadtočajevs
1251348c96 [Wayland] Implement keyboard_get_label_from_physical 2025-12-10 13:19:35 +02:00
Berke Güzel
48c50bacba Wayland: Fix laggy window resize
scale_changed and size_changed were incorrectly initialized to true,
causing redundant WindowRectMessage and DPI change events to be pushed
on every configure event regardless of actual changes.
2025-12-07 13:29:19 +03:00
Dery Almas
99b109e981 Wayland: Work around window scale ambiguity 2025-12-06 00:54:50 +01:00
Rémi Verschelde
1c7ef74f4f Merge pull request #113346 from deralmas/wl-keyboard-saga/unify-keys
Wayland: Unify key handling logic
2025-12-01 11:50:11 +01:00
Dery Almas
9a814b4444 Wayland: Unify key handling logic
Previously we had different logic for direct key presses and client-side
key repetition, as one queued up input events and the other dispatched
them directly (client-side key repetition is run from the main thread).

I kinda figured out that this difference doesn't really matter, as we
can queue them up before the thread message dispatching logic. That's
exactly what we do now, which allows us to make a single method for both
of them, making the code much clearer and simplifying future maintenance.

This patch also includes a tiny fixup in the compose logic, which checks
for the validity of the generated key event before actually working with
it. The cases in which we can end up with an invalid reference are very
few, so it's not the end of the world, but it's still absolutely a good
idea to check, to avoid nasty surprises down the line.
2025-11-30 05:11:40 +01:00
LanzaSchneider
3a965d50fe Fix incorrect format specifier for bool in Wayland libdecor 2025-11-29 10:20:27 +08:00
Riteo Siuga
f90a9ad659 Destroy XKB keymap and state on seat capability change
Wasn't that much of a concern as it would have been disposed of next
time a keyboard got added, but it's still a good thing to do.
2025-11-27 23:02:08 +01:00
Dery Almas
a79239e332 Wayland: Add default keyboard repetition values
The `wl_keyboard::repeat_info` event got introduced in version 4. On
versions older than that, we defaulted to 0 delay, which means no
repetition. That's a veeery old version and basically everything offers
it, but it doesn't hurt to add a reasonable default.
2025-11-27 22:37:28 +01:00
Dery Almas
b0a42784f1 Wayland: Fix SIGFPE with repeat rate of 0
We always divided by the rate, which could be zero, which is a valid
value (it means "disable key repeating").
2025-11-27 22:37:28 +01:00
Rémi Verschelde
e28ef68957 Merge pull request #113135 from deralmas/buffer-jaywalking
Wayland: Fix trailing garbage error while using the embedder on Jay
2025-11-27 21:48:12 +01:00
Rémi Verschelde
1667e6fcce Merge pull request #113195 from teromene/master
Include xkb-compose in `wayland_thread.h`
2025-11-26 23:44:49 +01:00
teromene
b8ef67586d Include xkb-compose in wayland_thread.h. Fixes builds without SOWRAP_ENABLED 2025-11-26 16:00:08 +01:00
Michael Alexsander
69ff129e33 Fix error message when closing the project manager on Wayland 2025-11-26 11:16:08 -03:00
Thaddeus Crews
0ebb11041b Merge pull request #113138 from deralmas/embedder-oopsies
Wayland: Fix Wayland driver in export templates
2025-11-25 07:06:59 -06:00
Dery Almas
8fb195e20d Wayland: Fix Wayland driver in export templates
I might have accidentally put the socket connection logic inside a
`TOOLS_ENABLED` `#ifdef` xD
2025-11-25 03:36:16 +01:00
Dery Almas
1fb101f7a5 Wayland: Fix trailing garbage error while using the embedder on Jay
`send_wayland_message` takes in the number of words, not its byte size.
This meant that we were sending quite a bit of out-of-bounds stuff
alongside the four arguments required by
`xdg_positioner::set_anchor_rect`, which triggered an assertion on Jay.

This didn't pop up before because the C wayland server library does not
seem to check this, but it's a valid (and useful!) assertion
for other server implementations nonetheless.

This patch switches to the initializer_list syntax to make the intent
clearer.
2025-11-25 01:34:52 +01:00
Thaddeus Crews
e1b3387513 Merge pull request #108704 from wjt/xdg-portal-inhibit
Support XDG Inhibit portal
2025-11-24 15:59:56 -06:00
Thaddeus Crews
7477823ad5 Merge pull request #113068 from deralmas/writing-with-style
Wayland: Implement compose and dead key support
2025-11-24 10:21:31 -06:00
Dery Almas
8ced63315a Wayland: Implement compose and dead key support 2025-11-22 23:30:23 +01:00
ArchercatNEO
4dd5c83f72 Wayland: compile with libdecor=no 2025-11-22 08:29:05 +00:00
metamuffin
6145b0ca29 Add Image.load_exr_from_buffer and enable tinyexr by default 2025-11-21 18:58:26 +01:00
Dery Almas
bbf65ae72f Wayland: Implement game embedding
This patch introduces a new protocol proxy, which multiplxes Wayland
clients into a single connection, allowing us to redirect calls (e.g.
create toplevel -> create subsurface). Mixed with some state tracking
and emulation, we can embed a full-featured client into the editor.
2025-11-19 21:24:18 +01:00
Will Thompson
1a3a254e26 Support XDG Inhibit portal
Previously, on Linux and BSD, inhibiting the screensaver was handled
using the org.freedesktop.ScreenSaver D-Bus API. Unfortunately, this API
is not available in a Flatpak sandbox. (This is because there is a
desire to tie inhibit sessions to a specific app and visible window; but
the org.freedesktop.ScreenSaver API does not support this.)

As a result, when using the Flatpak build of the Godot Editor (or a
Flatpak-ed build of a game) and using a controller to play a game, the
session will become idle after a few minutes.

The XDG desktop portal -- which is already used for color-picking, file
choosing, and querying the system theme -- has an Inhibit interface that
provides a superset of the functionality of the
org.freedesktop.ScreenSaver API, and is available to any sandboxed app.

Refactor code for making XDG portal requests that was previously
duplicated for the FileChooser and ColorPicker portal code. Check the
portal version to determine whether these portals can be used:

- FileChooser portal version 3 is required due to the use of the
  "directory" parameter.

- On the Settings portal, the only addition in version 2 is the
  ReadOne() method which is not used here, so version 1 suffices.

- On the Screenshot portal, the only addition in version 2 is the
  "interactive" parameter to the Screenshot() method; this code only
  uses the PickColor() method, so version 1 suffices.

Then, add support for the Inhibit portal. Use it if available and if
running in a sandbox. Prefer to use org.freedesktop.ScreenSaver if not
running in a sandbox, even if the portal is available, because (at least
in the GNOME 43 implementation of the portal) it does not work correctly
if the portal cannot map the request to a running app. This adds a small
amount of complexity to the implementation, but supporting both APIs is
necessary anyway (there are many systems in the wild that support
org.freedesktop.ScreenSaver but not the desktop portal).

Fixes https://github.com/godotengine/godot/issues/108634
2025-11-17 11:46:28 +01:00
Pāvels Nadtočajevs
281c74550a Make utterance_id 64-bit. 2025-11-07 10:21:20 +02:00
Thaddeus Crews
2d7380c3ff Merge pull request #111493 from deralmas/racing-the-thread
Wayland: Defer event thread initialization to late initialization
2025-11-06 08:13:13 -06:00
Riteo Siuga
4df96fc7ab Wayland: Set window parent before commit
Fixes a timing issue where dialogs got configured right before having
their parent set. This gave compositors the time to resize/rearrange the
dialog as if it were a normal window, only to be marked as "floating"
right away. On niri, this manifested as huge dialog windows.

This is achieved with the addition of a `p_parent_id` parameter to
`window_create`, akin to its popup counterpart.

`window_create` now also accepts a single `Size2i` parameter instead of
two integers, in line with the rest of the `WaylandThread` API. The
original idea was to have a very "barebones" API, akin to the `drivers/`
directory, but that didn't pan out.
2025-10-28 04:10:28 +01:00
Dery Almas
ab205a78ce Wayland: defer event thread initialization to late initialization
This race condition made me pull my hair. `wl_display_roundtrip` has its
own little event loop, which apparently conflicts hard with the
always-running event loop thread.

I kinda assumed that it would be thread-safe thanks to its internal
`wl_display_prepare_read` call that the docs talk about but that's
clearly not enough.

Luckily this method is called very few times and the only dangerous
instances are in the initialization routine, which first starts the
thread and then does various roundtrips. Libdecor has also some internal
roundtrips of its own which would often fail. Starting the thread after
all initialization fixes the issue.

Tested this by spamming *lots* of `wl_display_roundtrip` in
`WaylandThread::init()` with and without this fix.
2025-10-10 23:25:00 +02:00
Ben Rog-Wilhelm
0a584250ae Fix: Libgodot build on Linux. 2025-10-10 04:31:14 -05:00
Rémi Verschelde
a6e44be2dc Merge pull request #105587 from deralmas/framing-this-moment
Wayland: Emulate frame event for old `wl_seat` versions
2025-10-07 13:06:47 +02:00
Thaddeus Crews
5935a32e32 Core: Cleanup headers in core/config
- `MainLoop` now forward-declared in `OS`
2025-10-06 09:20:56 -05:00
chocola-mint
ead282ff13 Remove file_access.h and script_backtrace.h includes from logger.h. 2025-10-05 17:49:23 +09:00
Aaron Franke
3d1c9fd5de Move server files into their subfolders 2025-09-30 19:39:39 -07:00
Thaddeus Crews
373ff727f0 Merge pull request #110875 from vmedea/2025-wayland-inhibit-idle
wayland: Inhibit idle in DisplayServerWayland::screen_set_keep_on
2025-09-30 18:35:02 -05:00
Thaddeus Crews
21fd4faf1b Merge pull request #107469 from Ivorforce/vector-localvector-explicit-span-conversions
Remove implicit conversions between `LocalVector` and `Vector`
2025-09-30 11:19:17 -05:00
Mara Huldra
c64ff4b069 wayland: Inhibit idle in DisplayServerWayland::screen_set_keep_on
Without this, the screen does go into idle after a few minutes on a RPi5 with default install (wayland w/ labwc), even
though `screen_keep_on` is set. DBUS is enabled but apparently, the screensaver call is not enough.
2025-09-24 22:17:38 +02:00
Thaddeus Crews
ce157a446f Merge pull request #107096 from ArchercatNEO/xdg-toplevel-icon
Wayland: Implement the xdg-toplevel-icon-v1 protocol
2025-09-22 08:50:10 -05:00
Yufeng Ying
05dae23f18 Remove dependency of variant.h in print_string.h
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2025-09-19 14:57:36 +08:00
Lukas Tenbrink
abe3b481ae Make conversions from LocalVector to Vector explicit. 2025-09-16 21:41:28 +02:00
Pāvels Nadtočajevs
76433b0ede Fix Wayland build with OpenGL disabled. 2025-09-06 18:37:49 +03:00