cursor: implement implicit grabs

When a button is held down and the cursor leaves a surface, events now
continue to be sent to the client. This allows e.g. dragging a scroll
bar from outside the surface.
This commit is contained in:
Isaac Freund
2020-08-07 13:54:58 +02:00
parent 91052f7477
commit 0c4e3295b1
2 changed files with 55 additions and 29 deletions

View File

@ -108,6 +108,7 @@ pub fn isCursorActionTarget(self: Self, view: *View) bool {
const seat = &node.data;
switch (seat.cursor.mode) {
.passthrough => {},
.down => |target_view| if (target_view == view) break true,
.move => |target_view| if (target_view == view) break true,
.resize => |data| if (data.view == view) break true,
}