Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

ckerr
Copy link
Member

@ckerr ckerr commented Feb 8, 2024

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 in the last 24 hours 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 in the last 24 hours label Feb 9, 2024
@ckerr
Copy link
Member Author

ckerr commented Feb 9, 2024

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
24 of 25 checks passed
@ckerr ckerr deleted the fix/41143-get-cursor-screenpoint-wrongly-returns-origin branch February 9, 2024 15:44
Copy link

release-clerk bot commented Feb 9, 2024

Release Notes Persisted

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

@trop
Copy link
Contributor

trop bot commented Feb 9, 2024

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