Skip to content

fix: apply the X11 input shape before setIgnoreMouseEvents() returns - #54487

Merged
codebytere merged 1 commit into
mainfrom
fix-x11-sync-ignore-mouse-events
Sep 28, 2026
Merged

codebytere merged 1 commit into
mainfrom
fix-x11-sync-ignore-mouse-events

Conversation

@codebytere

Copy link
Copy Markdown
Member

Description of Change

On X11, setIgnoreMouseEvents() did not take effect until the main process next went back to its event loop. The XShape request sat in the client-side output buffer, so a window kept receiving (or kept ignoring) mouse events for as long as the caller stayed busy after the call.

The call now round-trips to the X server after updating the input region. A flush is not enough: it only writes the request to the socket, and the server makes no ordering promise between clients, so only a reply shows the shape is in place before another client's next request is handled. Wayland is unchanged - the region applies with the next surface commit, which is already forced, and blocking the UI thread on a compositor round-trip isn't appropriate. The forced redraw is now Wayland-only since X11 never needed it.

Verified under Xvfb by reading the input shape from a second X client while the main thread was busy right after the call: 1x1 after setIgnoreMouseEvents(true) and the full window after false, where main still reports the previous shape at both points. No new spec because CI cannot read the input shape.

Checklist

Release Notes

Notes: Fixed setIgnoreMouseEvents() taking effect late on X11.

The XShape request that setIgnoreMouseEvents() issues on X11 stayed in the
client-side output buffer until the UI thread next returned to its message
loop, so the window kept receiving (or kept ignoring) mouse events for as
long as the caller stayed busy. Round-trip to the server after updating the
region. A flush alone only writes the request to the socket; the server
gives no ordering guarantee between clients, so only a reply shows that the
shape is in place before another client's next request is processed.
@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 27, 2026
@codebytere
codebytere merged commit 4205b36 into main Sep 28, 2026
123 checks passed
@release-clerk

release-clerk Bot commented Sep 28, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed setIgnoreMouseEvents() taking effect late on X11.

@trop

trop Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

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

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

trop Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/44-x-y in-flight/43-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/43-x-y PR should also be added to the "43-x-y" branch. in-flight/44-x-y in-flight/43-x-y labels Sep 28, 2026
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Sep 28, 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