Skip to content

fix: keep setIgnoreMouseEvents(true) in effect on Linux and support it on Wayland - #54375

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix-linux-ignore-mouse-events-input-region
Sep 25, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
fix-linux-ignore-mouse-events-input-region

Conversation

@codebytere

@codebytere codebytere commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Fixes #52456.

After this change setIgnoreMouseEvents(true) keeps working on X11 after the window is moved, resized, shown or re-themed, and it works on Wayland, where it was a no-op.

Since the 43 frame-view refactor, ElectronDesktopWindowTreeHostLinux::UpdateFrameHints() runs for frameless windows too and resets the platform window's input region on every bounds, state, scale and theme change. setIgnoreMouseEvents(true) still set a 1x1 X input shape directly on the window, so the first setBounds() or show after the call wiped it. Only the X11 branch existed, hence nothing on Wayland.

The ignore state now lives on NativeWindowViews and is applied at the end of UpdateFrameHints() through PlatformWindow::SetInputRegion, which X11 and Wayland toplevels both implement; a redraw is scheduled so Wayland commits the region without waiting for the next paint, and the raw XShape calls are gone. Verified on X11 under Xvfb by reading the input shape: 1x1 after the call and still 1x1 after setBounds() (main resets it to the full window), full again after setIgnoreMouseEvents(false). Wayland verified by reading; no spec because CI cannot read the input shape.

Checklist

Release Notes

Notes:

  • Fixed setIgnoreMouseEvents(true) being undone by the next resize on X11.
  • Added setIgnoreMouseEvents support on Wayland.

…t on Wayland

Since the 43 frame-view refactor the tree host's frame-hint pass resets the
window input region on every bounds, state and theme change, which undid
the X11 input shape that setIgnoreMouseEvents(true) had set directly. Keep
the ignore state on the window and apply it from the frame-hint pass
through PlatformWindow::SetInputRegion instead. That path is implemented
for Wayland toplevels as well, so the call now also works there.
@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 25, 2026
@MarshallOfSound
MarshallOfSound merged commit ccf74d5 into main Sep 25, 2026
101 checks passed
@release-clerk

release-clerk Bot commented Sep 25, 2026

Copy link
Copy Markdown

Release Notes Persisted

  • Fixed setIgnoreMouseEvents(true) being undone by the next resize on X11.
  • Added setIgnoreMouseEvents support on Wayland.

@MarshallOfSound
MarshallOfSound deleted the fix-linux-ignore-mouse-events-input-region branch September 25, 2026 16:11
@trop

trop Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/45-x-y merged/44-x-y PR was merged to the "44-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/44-x-y labels Sep 25, 2026
@trop

trop Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@codebytere has manually backported this PR to "43-x-y", please check out #54423

codebytere added a commit that referenced this pull request Sep 26, 2026
…t on Wayland (#54423)

fix: keep setIgnoreMouseEvents(true) in effect on Linux and support it on Wayland (#54375)

Since the 43 frame-view refactor the tree host's frame-hint pass resets the
window input region on every bounds, state and theme change, which undid
the X11 input shape that setIgnoreMouseEvents(true) had set directly. Keep
the ignore state on the window and apply it from the frame-hint pass
through PlatformWindow::SetInputRegion instead. That path is implemented
for Wayland toplevels as well, so the call now also works there.

(cherry picked from commit ccf74d5)
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed 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.

[Bug]: setIgnoreMouseEvents no longer makes transparent windows click-through on Linux/X11 in Electron 43

2 participants