[client] wayland: marshal resize requests to the event-loop thread

setWindowSize is called from the render, frame and transport threads,
but shellResize issues shell requests and, with the libdecor GTK
plugin, renders the window decorations through pango, none of which is
thread safe. A frame thread exiting after such a call crashed in the
pango fontmap destructor during thread teardown.

Publish the requested size atomically and wake the event loop through
an eventfd registered in the epoll; the poll callback applies the size
on the event-loop thread. Concurrent requests coalesce into the most
recent one.
This commit is contained in:
Amit Mendapara
2026-08-11 18:11:03 +05:30
committed by Geoffrey McRae
parent 574e8edbae
commit c66a974f1d
3 changed files with 67 additions and 1 deletions

View File

@@ -148,6 +148,9 @@ struct WaylandDSState
bool warpSupport;
struct WlMotion motion;
_Atomic(uint64_t) pendingResize; // 0 = none, else (width << 32) | height
int resizeEventFd; // wakes the event loop to apply it
#if defined(ENABLE_EGL) || defined(ENABLE_OPENGL)
struct wl_egl_window * eglWindow;
struct SwapWithDamageData swapWithDamage;