Wayland: Improve mapping robustness and synchronization#117385
Merged
Conversation
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
approved these changes
Mar 13, 2026
Member
|
Thanks! |
Contributor
|
Cherry-picked for 4.6.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)