More fixes around set_grab/unset_grab#1391
Merged
Merged
Conversation
It's easy enough to change the type generic to use this in all three places, so we might as well.
This was already supposed to happen, but I hadn't noticed that these functions don't delegate to a method of the innter handle, like they do with touch. This is a breaking API change, since these functions then need to take `&mut D`. But this seems reasonable since the equivalents for pointer/touch already require that, and `&mut D` should be available to call wherever these are used.
This fixes an issue I noticed where cancelled drag-and-drop in clients like Firefox and Nautilus caused a window to ignore pointer events until losing and regaining focus. It seems calling the `.ungrab` method at the end of `with_grab` means calling it after pointer focus is restored, and clients seem not to handle the `wl_pointer.enter` before the drag is actually over. Deferring the focus restoration as well is slightly complicated to implement, and seems problematic when it involves a serial. Maybe there shouldn't be any input events after the `*set_grab` call but before returning, but this seems cleaner. Taking a reference to the handler in `*InterHandle.*set_grab` is a bit annoying, but easy enough to deal with, and allows this to work more cleanly. This seems reasonable as long as we don't have a better solution to the whole `GrabStatus::Borrowed` thing.
ids1024
added a commit
to pop-os/cosmic-comp
that referenced
this pull request
Apr 16, 2024
Updates for changes in Smithay/smithay#1391.
Drakulix
pushed a commit
to pop-os/cosmic-comp
that referenced
this pull request
Apr 17, 2024
Updates for changes in Smithay/smithay#1391.
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.
This is a followup to #1386, which I noticed an issue with: cancelled drags in clients like Firefox and Nautilus caused the window to act like it didn't have pointer focus until it lost and regained it. It seems the the previous change in
KeyboardGrabalso wasn't quite right.See commit messages for more specific details.
This is a breaking API change requiring passing additional arguments, but although a bit annoying to update for, it's pretty straightforward.