view: forbid mode change if cursor target
Making a floating view tiled during a resize breaks things badly.
This commit is contained in:
@ -26,6 +26,7 @@ const util = @import("util.zig");
|
||||
|
||||
const Seat = @import("Seat.zig");
|
||||
const Server = @import("Server.zig");
|
||||
const View = @import("View.zig");
|
||||
|
||||
const default_seat_name = "default";
|
||||
|
||||
@ -101,6 +102,18 @@ pub fn inputAllowed(self: Self, wlr_surface: *c.wlr_surface) bool {
|
||||
true;
|
||||
}
|
||||
|
||||
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 => {},
|
||||
.move => |data| if (data.view == view) break true,
|
||||
.resize => |data| if (data.view == view) break true,
|
||||
}
|
||||
} else false;
|
||||
}
|
||||
|
||||
fn handleInhibitActivate(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
|
||||
const self = @fieldParentPtr(Self, "listen_inhibit_activate", listener.?);
|
||||
|
||||
|
Reference in New Issue
Block a user