Add restore_focus
argument to PointerInnerHandle::unset_grab
#1173
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.
Used in
ClickGrab
to preventmotion
events from occurring with everybutton
event. Otherwise, behavior should be unchanged. This matches the argument taken byKeyboardInnerHandle::unset_grab
.This seems like the simplest solution. It would also be possible to add a method to the
PointerGrab
trait indicating if focus should be restored, but that's complicated sinceunset_grab
can't access thegrab when it's
Borrowed
, so it would have to add a bool toGrabStatus::Borrowed
, etc.This still doesn't send a
frame
, but since this takes a serial and a time, it probably will be sent along with other pointer events, and hopefully part of aframe
. The Wayland spec isn't all that specificabout when things can/should be part of a
frame
...Calling
motion
is also incorrect with pointer constraints, but grabs other thanClickGrab
generally shouldn't exist while a constraint is active. It would be good to enforce that some way.The first commit here is a change I had as part of an attempt at a different approach, which turned out more complicated; but this part seemed a bit neater.
Fixes #1148.