cursor: leave mode if target view is destroyed

This commit is contained in:
Isaac Freund
2020-08-21 16:23:23 +02:00
parent db416eb119
commit 7274761069
3 changed files with 29 additions and 13 deletions

View File

@ -107,13 +107,7 @@ pub fn inputAllowed(self: Self, wlr_surface: *c.wlr_surface) bool {
pub fn isCursorActionTarget(self: Self, view: *View) bool {
var it = self.seats.first;
return while (it) |node| : (it = node.next) {
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,
}
if (node.data.cursor.isCursorActionTarget(view)) break true;
} else false;
}