godot/platform/linuxbsd/wayland
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
..
dynwrappers Wayland: Fix build config with so_wrap disabled 2025-02-10 21:42:25 +01:00
detect_prime_egl.cpp Remove dependency of variant.h in print_string.h 2025-09-19 14:57:36 +08:00
detect_prime_egl.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
display_server_wayland.cpp Core: Cleanup headers in core/config 2025-10-06 09:20:56 -05:00
display_server_wayland.h Move server files into their subfolders 2025-09-30 19:39:39 -07:00
egl_manager_wayland.cpp Add Wayland support 2024-01-30 16:44:47 +01:00
egl_manager_wayland.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
egl_manager_wayland_gles.cpp Wayland: Add support for OpenGL ES driver 2024-05-03 05:17:13 +02:00
egl_manager_wayland_gles.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
key_mapping_xkb.cpp Wayland: Unstuck keys with same keycode 2025-02-11 13:16:16 +01:00
key_mapping_xkb.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
rendering_context_driver_vulkan_wayland.cpp Move Vulkan includes to a central godot_vulkan.h header 2024-09-29 17:53:18 +02:00
rendering_context_driver_vulkan_wayland.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
SCsub Fix: Libgodot build on Linux. 2025-10-10 04:31:14 -05:00
wayland_thread.cpp Wayland: defer event thread initialization to late initialization 2025-10-10 23:25:00 +02:00
wayland_thread.h Move server files into their subfolders 2025-09-30 19:39:39 -07:00