Repository navigation
fix: honor win.setEnabled(false) and modal parents under Wayland - #54427
Merged
Merged
Conversation
On Linux, disabling a window (setEnabled(false), or opening a modal child) only took effect under X11; under Wayland the window kept receiving input and isEnabled() always returned true. Replace the X11-only EventDisabler rewriter with the window tree host's DisableEventListening(), which blocks event dispatch the same way on both X11 and Wayland, and run the disabling specs on Wayland too.
MarshallOfSound
approved these changes
Sep 26, 2026
|
Release Notes Persisted
|
This was referenced Sep 26, 2026
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #54446 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54447 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54448 |
3 tasks done
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.
Description of Change
On Linux,
win.setEnabled(false)and showing amodal: truechild only blocked input to the window under X11. Under Wayland the window kept receiving clicks and keys andwin.isEnabled()always returnedtrue, because the implementation installed an X11-only event rewriter behind anIsX11()check.This switches to
DesktopWindowTreeHostLinux::DisableEventListening(), which Chromium uses to make a window inert behind its own modal dialogs and which behaves the same on X11 and Wayland, and deletes the rewriter. The "disabling parent windows" specs now run on the Wayland lane too.Tested under Xvfb and weston 13 with synthetic pointer and keyboard input, and on Ubuntu 24.04 GNOME (Mutter, Wayland session): a disabled window and a modal's parent drop clicks and keys and get them back when re-enabled or when the child closes, on both backends.
Checklist
Release Notes
Notes: Fixed
win.setEnabled(false)and modal child windows not blocking input on Wayland.