#54487: fix: apply the X11 input shape before setIgnoreMouseEvents() returns
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
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
Release Notes
Notes: Fixed setIgnoreMouseEvents() taking effect late on X11.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron