Skip to content

fix: honor win.setEnabled(false) and modal parents under Wayland - #54427

Merged
deepak1556 merged 1 commit into
mainfrom
fix-wayland-set-enabled
Sep 26, 2026
Merged

deepak1556 merged 1 commit into
mainfrom
fix-wayland-set-enabled

Conversation

@codebytere

Copy link
Copy Markdown
Member

Description of Change

On Linux, win.setEnabled(false) and showing a modal: true child only blocked input to the window under X11. Under Wayland the window kept receiving clicks and keys and win.isEnabled() always returned true, because the implementation installed an X11-only event rewriter behind an IsX11() 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.

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.
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 26, 2026

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@deepak1556
deepak1556 merged commit ff6681b into main Sep 26, 2026
124 checks passed
@release-clerk

release-clerk Bot commented Sep 26, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed win.setEnabled(false) and modal child windows not blocking input on Wayland.

@trop

trop Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #54446

@trop trop Bot removed the target/43-x-y PR should also be added to the "43-x-y" branch. label Sep 26, 2026
@trop

trop Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #54447

@trop

trop Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #54448

@trop trop Bot added in-flight/44-x-y in-flight/45-x-y merged/45-x-y PR was merged to the "45-x-y" branch. and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. in-flight/45-x-y labels Sep 26, 2026
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/44-x-y in-flight/43-x-y labels Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants