-
Notifications
You must be signed in to change notification settings - Fork 932
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
wayland: ignore events for dead objects #3774
Conversation
return; | ||
} | ||
seat_state | ||
}, | ||
None => return, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also warn on this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made it a bit more broken compositor proof, though, keep in mind that the old code is like that for like ~7 years, it's just some 4chan devs decided to yolo recently.
if seat_state.pointer.is_none() { | ||
warn!("Received pointer event without pointer"); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing is_none
, we should use a match
here and out the result into a let pointer
variable. That way we don't have to unwrap
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored that way because I've assumed that it'll fail due to borrowing somehow, however it seems to work.
Nothing wrong will happen if we ignore events when compositor is at wrong, at least crashing because compositor is just _wrong_ probably is not a great option. Links: alacritty/alacritty#8065
e7397d6
to
ad4a4e5
Compare
Nothing wrong will happen if we ignore events when compositor is at wrong, at least crashing because compositor is just wrong probably is not a great option.
Links: alacritty/alacritty#8065
changelog
module if knowledge of this change could be valuable to users--
Whatever, the other part of this "fix" will require Smithay/client-toolkit#461 , though, it could be patch bumped by the library users.