From 3605a46bb520313945e0417e1ae8be17b344e6df Mon Sep 17 00:00:00 2001 From: Wouter van Heijst Date: Sat, 6 Jan 2024 13:54:45 +0200 Subject: Cursor: Focus follows cursor focuses empty outputs When `focus-follows-cursor` is set and the cursor moves onto an output where no views are present on the currently visible tags, focus the output itself instead of an individual view. This is useful e.g. when you want to spawn a terminal on your empty monitor or switch it to a different tag. Previously such changes would happen to the monitor on which you previous focus was, despite the cursor being somewhere else. --- river/Cursor.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/river/Cursor.zig b/river/Cursor.zig index e74b300..f281876 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -909,6 +909,9 @@ pub fn checkFocusFollowsCursor(self: *Self) void { self.seat.focus(view); server.root.applyPending(); } + } else { + // The output doesn't contain any views, just focus the output. + self.updateOutputFocus(self.wlr_cursor.x, self.wlr_cursor.y); } } -- cgit v1.2.3