change output when pointer moves between them

This commit is contained in:
Basil Keeler 2026-03-28 20:33:25 -05:00 committed by Ben Buhse
commit 648910c803

View file

@ -111,6 +111,13 @@ fn seatListener(river_seat_v1: *river.SeatV1, event: river.SeatV1.Event, seat: *
.pointer_position => |ev| { .pointer_position => |ev| {
seat.pointer_pos.x = ev.x; seat.pointer_pos.x = ev.x;
seat.pointer_pos.y = ev.y; seat.pointer_pos.y = ev.y;
// Iterate over every display and check if the curser is inside it
var it = seat.context.wm.outputs.iterator(.forward);
while (it.next()) |output| {
if (utils.isPosInRect(seat.pointer_pos, output.geometry)) {
seat.focused_output = output;
}
}
}, },
else => |ev| { else => |ev| {