aboutsummaryrefslogtreecommitdiff
path: root/src/view.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-17 13:22:23 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-17 13:22:35 +0200
commit76fedd74500860c1a9ef190ab9f37415ec727b1a (patch)
tree8a8a1d500699c9f88bab6cfa7c3f0423a6879672 /src/view.zig
parent5607163b20a11b72289f2a524b58f1b11125e385 (diff)
downloadriver-76fedd74500860c1a9ef190ab9f37415ec727b1a.tar.gz
river-76fedd74500860c1a9ef190ab9f37415ec727b1a.tar.xz
Fix focus handling of newly mapped Views
Diffstat (limited to 'src/view.zig')
-rw-r--r--src/view.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/view.zig b/src/view.zig
index 08b168f..6af7fe2 100644
--- a/src/view.zig
+++ b/src/view.zig
@@ -148,8 +148,14 @@ pub const View = struct {
c.wl_signal_add(&view.wlr_xdg_surface.surface.*.events.commit, &view.listen_commit);
view.mapped = true;
- // TODO: remove this hack
- root.server.input_manager.seats.first.?.data.focus(view);
+
+ // Focus the newly mapped view. Note: if a seat is focusing a different output
+ // it will continue to do so.
+ var it = root.server.input_manager.seats.first;
+ while (it) |seat_node| : (it = seat_node.next) {
+ seat_node.data.focus(view);
+ }
+
view.output.root.arrange();
}