Skip to content

Wayland: Improve mapping robustness and synchronization#117385

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
deralmas:wl/mapping-improvements
Mar 14, 2026
Merged

Wayland: Improve mapping robustness and synchronization#117385
akien-mga merged 1 commit into
godotengine:masterfrom
deralmas:wl/mapping-improvements

Conversation

@deralmas

Copy link
Copy Markdown
Member

Fixes #115739.
Should fix #104752. (Didn't replicate on any of my usual compositors)

We assumed that a window will be ready after a single roundtrip but that's actually not guaranteed by the XDG shell protocol.

This patch waits for an arbitrary timeout (10s) before erroring out and forcefully closing the window. Since this exercised quite some code paths, it also reworks some window handling logic and fixes a bunch of synchronization issues.


Tested with Pinnacle 0.2.2 (built from commit b6c40da68024fb7fbb1db1f0890a87b08da013c9) on my KISS Linux laptop by following the steps from the linked issue. Couldn't notice any obvious regression on my KISS Linux laptop with sway 1.11 and my Fedora 43 VM with KDE 6.5.4, GNOME 49.2.2, and COSMIC 1.0.1.

Note that this solution isn't ideal as the world stops while waiting. We should obviously make everything asynchronous but I'm not entirely sure how much that is possible.

If the timed out window is the main window the engine will fall back to X11 properly, although for some reason only in this case DetectPrimeX11 (if invoked) stalls. I'd really postpone this issue to another PR if possible, given how specific it is. (Does it even count as a regression? :P)

We assumed that a window will be ready after a single roundtrip but
that's actually not guaranteed by the XDG shell protocol.

This patch waits for an arbitrary timeout (10s) before erroring out and
forcefully closing the window. Since this exercised quite some code
paths, it also reworks some window handling logic and fixes a bunch of
synchronization issues.
@akien-mga akien-mga merged commit bd8b832 into godotengine:master Mar 14, 2026
20 checks passed
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@akien-mga akien-mga added cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release crash labels Mar 25, 2026
@Repiteo

Repiteo commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked for 4.6.2.

@Repiteo Repiteo removed the cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment