fix: screen.getCursorScreenPoint() crash on Wayland#50092
Merged
Conversation
codebytere
reviewed
Mar 5, 2026
1a7bd6f to
6dbab20
Compare
4 tasks
mitchchn
reviewed
Mar 5, 2026
6dbab20 to
8aa005c
Compare
Member
Author
|
@codebytere @mitchchn y'all make good points about this method returning an unhelpful value on Wayland even when it doesn't crash. I've updated the PR accordingly. |
mitchchn
approved these changes
Mar 6, 2026
fix: support Screen::GetCursorScreenPoint() on X11
8aa005c to
0621538
Compare
codebytere
approved these changes
Mar 6, 2026
jkleinsc
approved these changes
Mar 6, 2026
|
Release Notes Persisted
|
This was referenced Mar 6, 2026
Contributor
|
I have automatically backported this PR to "40-x-y", please check out #50104 |
Contributor
|
I have automatically backported this PR to "41-x-y", please check out #50105 |
Contributor
|
I have automatically backported this PR to "39-x-y", please check out #50106 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Closes #50079.
require a Window to exist before calling Screen::getCursorScreenPoint()
CC @codebytere @mitchchn
ui::WaylandScreen::GetCursorScreenPoint()requires at least one window to exist or it can DCHECK / dereference a nullptr. We used to work around this with #35503 but that approach no longer works. This PR is similar in spirit to 35503 but instead checks that!WindowList.IsEmpty()to confirm that at least one window exists.Checklist
npm testpassesRelease Notes
Notes: Fixed an issue where
screen.getCursorScreenPoint()crashed on Wayland when it was called before aBrowserWindowhad been created