Repository navigation
fix: keep focus on the surface that received press, so it receives release - #2181
hojjatabdollahi wants to merge 1 commit into
Conversation
|
I guess the problem here is that we can't use a ClickGrab because Smithay doesn't have a grab stack/tree system? |
| if *new_target == target { | ||
| location = *new_location; | ||
| } |
There was a problem hiding this comment.
I ended up disabling this new part in the default ClickGrab in niri btw because it results in more accidental interactions when scrolling is involved. With popups it's not such a big deal since you'd need quite specific conditions in niri to trigger scrolling with a click inside a popup (usually, a non-autoclosing popup). So I'm not sure it's worth going through the trouble to make this overridable. I guess it's one more thing that would resolve itself once Smithay has a grab stack/tree system since it'd just use the normal ClickGrab.
There was a problem hiding this comment.
Makes sense. I mirrored ClickGrab::motion, but I'm happy to drop these three lines, since they're not doing much here.
But I agree a grab stack would've been able to push the ClickGrab on top of the popup grab and release would pop it. Until then this should be OK.
Yeah, I would flag this as another symptom of our inadequate grab system. I am not sure I like this change because in general there might be cases, where the pointer leaving is all the application in question does need to know. We shouldn't inject events to return things to a neutral position. This doesn't necessarily inject events, but it does redirect them when the ClickGrab already should handle it. |
ClickGrab doesn't handle this AFAICT. We don't have a grab stack, so only one grab is active. ClickGrab is installed by DefaultGrab. But when PopupPointerGrab is active it receives the press. This gives PopupPointerGrab the same focus behaviour ClickGrab::motion has while buttons are held, and nothing more. It doesn't create or reorder any events. The client just gets the release on the surface it pressed on, as it would anywhere outside a popup. The leave is sent later on the first motion after the release, which is also what happens with the normal ClickGrab too. |
Yeah, so we duplicate logic, when we really should support nesting instead. :/ |
Description
If you drag a slider in an applet in cosmic-comp and while dragging exit the bounds of the applet, then release the mouse button. The release event doesn't get delivered to the applet.
Before:
before.mp4
After:
after.mp4
Checklist