Fix focus handling on output cycle

This commit is contained in:
Isaac Freund 2020-04-15 20:02:55 +02:00
parent 8a326541f6
commit 414a076410
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -65,11 +65,16 @@ pub const Seat = struct {
v.current_tags & self.focused_output.current_focused_tags == 0 v.current_tags & self.focused_output.current_focused_tags == 0
else else
true) { true) {
// Set view to the first currently visible view in the focus stack if any // Set view to the first currently visible view on in the focus stack if any
view = if (ViewStack(*View).iterator( var it = ViewStack(*View).iterator(
self.focus_stack.first, self.focus_stack.first,
self.focused_output.current_focused_tags, self.focused_output.current_focused_tags,
).next()) |node| node.view else null; );
view = while (it.next()) |node| {
if (node.view.output == self.focused_output) {
break node.view;
}
} else null;
} }
if (self.focused_view) |current_focus| { if (self.focused_view) |current_focus| {