Skip to content

fix: GetCursorScreenpoint() sometimes wrongly returns (0,0) - #41275

Merged
ckerr merged 1 commit into
mainfrom
fix/41143-get-cursor-screenpoint-wrongly-returns-origin
Feb 9, 2024
Merged

ckerr merged 1 commit into
mainfrom
fix/41143-get-cursor-screenpoint-wrongly-returns-origin

Conversation

@ckerr

@ckerr ckerr commented Feb 8, 2024

Copy link
Copy Markdown
Member

Description of Change

Fixes #41143.

The bug was introduced in https://chromium-review.googlesource.com/c/chromium/src/+/5214873 which tests for x11::Input::CrossingEvent but calls ui::EventSystemLocationFromXEvent(), which uses the similarly-named-but-different-class x11::CrossingEvent. This mismatch causes x11::Input::CrossingEvents to incorrectly record the cursor's location at 0, 0.

https://chromium-review.googlesource.com/c/chromium/src/+/5225569 exposed the 5214873 bug to Electron via X11ScreenOzone::GetCursorScreenPoint(), which caches the return value of X11ScreenOzone::GetCursorScreenPoint() to avoid a round trip to X.

This patch should be backported to e29 to fix the release blocker + upstreamed to Chromium.

All reviews welcome!

Checklist

Release Notes

Notes: Fixed Electron 29.0.0-beta.3 regression that could pop up context menus in the wrong location.

@ckerr ckerr added platform/linux semver/patch backwards-compatible bug fixes target/29-x-y PR should also be added to the "29-x-y" branch. labels Feb 8, 2024
@ckerr
ckerr requested a review from a team as a code owner February 8, 2024 07:02
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Feb 8, 2024
@codebytere codebytere changed the title fix: GetCursorScreenpoint() sometimes wrongly returns 0,0 fix: GetCursorScreenpoint() sometimes wrongly returns (0,0) Feb 8, 2024
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Feb 9, 2024
@ckerr

ckerr commented Feb 9, 2024

Copy link
Copy Markdown
Member Author

CI is failing due to known unrelated CI flake #41295 & should be safe to merge

@ckerr
ckerr merged commit 9655ae7 into main Feb 9, 2024
@ckerr
ckerr deleted the fix/41143-get-cursor-screenpoint-wrongly-returns-origin branch February 9, 2024 15:44
@release-clerk

release-clerk Bot commented Feb 9, 2024

Copy link
Copy Markdown

Release Notes Persisted

Fixed Electron 29.0.0-beta.3 regression that could pop up context menus in the wrong location.

@trop

trop Bot commented Feb 9, 2024

Copy link
Copy Markdown
Contributor

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

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

Labels

merged/29-x-y PR was merged to the "29-x-y" branch. platform/linux semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: context menu on Ubuntu/x11 in the top left of the screen on 29.0.0-beta.3

2 participants