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

wayland: ignore events for dead objects #3774

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

kchibisov
Copy link
Member

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

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

--

Whatever, the other part of this "fix" will require Smithay/client-toolkit#461 , though, it could be patch bumped by the library users.

@kchibisov kchibisov requested review from daxpedda and madsmtm July 3, 2024 20:02
return;
}
seat_state
},
None => return,
Copy link
Member

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?

Copy link
Member Author

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.

Comment on lines 47 to 50
if seat_state.pointer.is_none() {
warn!("Received pointer event without pointer");
return;
}
Copy link
Member

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.

Copy link
Member Author

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
@kchibisov kchibisov force-pushed the kchibisov/wayland-ignore-broken branch from e7397d6 to ad4a4e5 Compare July 3, 2024 20:42
@kchibisov kchibisov requested a review from notgull July 3, 2024 20:43
@kchibisov kchibisov merged commit 1170554 into master Jul 5, 2024
53 checks passed
@kchibisov kchibisov deleted the kchibisov/wayland-ignore-broken branch July 5, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants