aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2023-03-16 15:10:52 +0100
committerIsaac Freund <mail@isaacfreund.com>2023-03-16 15:10:52 +0100
commiteaa2f6d37ea050104e1111cb4c98d761888124d4 (patch)
treee3760a915b4995b497c11d81838571a7570c4512
parent133b88c266d9de2b567bb551aeaa69328ab0dd80 (diff)
downloadriver-eaa2f6d37ea050104e1111cb4c98d761888124d4.tar.gz
river-eaa2f6d37ea050104e1111cb4c98d761888124d4.tar.xz
LayerSurface: fix surfaces on multiple outputs at once
The previous commit broke handling of keyboard interactive layer surfaces being created on multiple outputs at once. This new approach reverts part of the logic change in the previous commit while keeping the fix for the crash and the new assertion.
-rw-r--r--river/LayerSurface.zig15
1 files changed, 10 insertions, 5 deletions
diff --git a/river/LayerSurface.zig b/river/LayerSurface.zig
index 690be64..c7e2aef 100644
--- a/river/LayerSurface.zig
+++ b/river/LayerSurface.zig
@@ -166,11 +166,16 @@ fn handleKeyboardInteractiveExclusive(output: *Output) void {
while (it) |node| : (it = node.next) {
const seat = &node.data;
- if (topmost_surface) |to_focus| {
- // If we found a surface that requires focus, grab the focus of all
- // seats.
- seat.setFocusRaw(.{ .layer = to_focus });
- } else if (seat.focused == .layer) {
+ if (seat.focused_output == output) {
+ if (topmost_surface) |to_focus| {
+ // If we found a surface on the output that requires focus, grab the focus of all
+ // seats that are focusing that output.
+ seat.setFocusRaw(.{ .layer = to_focus });
+ continue;
+ }
+ }
+
+ if (seat.focused == .layer) {
const current_focus = seat.focused.layer.wlr_layer_surface;
// If the seat is currently focusing an unmapped layer surface or one
// without keyboard interactivity, stop focusing that layer surface.