aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2021-05-07 07:23:55 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-05-19 14:15:28 +0200
commit6333e465d2e1fddfc5bd995b4e17413c740f24b5 (patch)
tree8e37e0ebef5c6d34d2df39ebab36cc43f030e857
parent6ab06120fa09cd2dc84d4af5d16d074a9ca0fb4e (diff)
downloadriver-6333e465d2e1fddfc5bd995b4e17413c740f24b5.tar.gz
river-6333e465d2e1fddfc5bd995b4e17413c740f24b5.tar.xz
Allow changing output focus with pointer
-rw-r--r--river/Seat.zig10
1 files changed, 7 insertions, 3 deletions
diff --git a/river/Seat.zig b/river/Seat.zig
index 10ae97b..d47d64c 100644
--- a/river/Seat.zig
+++ b/river/Seat.zig
@@ -122,10 +122,14 @@ pub fn focus(self: *Self, _target: ?*View) void {
// While a layer surface is focused, views may not recieve focus
if (self.focused == .layer) return;
- // If the view is not currently visible, behave as if null was passed
if (target) |view| {
- if (view.output != self.focused_output or
- view.pending.tags & self.focused_output.pending.tags == 0) target = null;
+ // If the view is not currently visible, behave as if null was passed
+ if (view.pending.tags & view.output.pending.tags == 0) {
+ target = null;
+ } else {
+ // If the view is not on the currently focused output, focus it
+ if (view.output != self.focused_output) self.focusOutput(view.output);
+ }
}
// If the target view is not fullscreen or null, then a fullscreen view