diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-18 21:15:03 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-19 14:31:40 +0200 |
| commit | cd9d4ee395b8b3cf7e12227ea2f8be640e968aab (patch) | |
| tree | 575265d9ddcf13225c9120f611585244e4437e89 /src/output.zig | |
| parent | 5244618b015e40a5de228b85d28b4fce25bed152 (diff) | |
| download | river-cd9d4ee395b8b3cf7e12227ea2f8be640e968aab.tar.gz river-cd9d4ee395b8b3cf7e12227ea2f8be640e968aab.tar.xz | |
Grab seats focused on the output for layer shell
Diffstat (limited to 'src/output.zig')
| -rw-r--r-- | src/output.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/output.zig b/src/output.zig index c8c4e44..3475f8c 100644 --- a/src/output.zig +++ b/src/output.zig @@ -252,8 +252,8 @@ pub const Output = struct { self.arrangeLayer(self.layers[layer], full_box, &usable_box, false); } - // If there is any layer surface in the top or overlay layers which requests - // keyboard interactivity, give it focus. + // Find the topmost layer surface in the top or overlay layers which + // requests keyboard interactivity if any. const topmost_surface = outer: for (layer_idxs[0..2]) |layer| { // Iterate in reverse order since the last layer is rendered on top var it = self.layers[layer].last; @@ -268,6 +268,12 @@ pub const Output = struct { var it = self.root.server.input_manager.seats.first; while (it) |node| : (it = node.next) { const seat = &node.data; + + // Only grab focus of seats which have the output focused + if (seat.focused_output != self) { + continue; + } + if (topmost_surface) |to_focus| { // If we found a surface that requires focus, grab the focus of all // seats. |
