aboutsummaryrefslogtreecommitdiff
path: root/src/Server.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-05-11 23:43:04 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-05-11 23:43:04 +0200
commit5bec8f4fcb361d3c7527d367bc66c0810e3c91d9 (patch)
treed75a4ea10140d854efbd8d2c4d9f7654c9b15c78 /src/Server.zig
parentb2f172e91b2d75b0b2af02621ab302afce3a94d6 (diff)
downloadriver-5bec8f4fcb361d3c7527d367bc66c0810e3c91d9.tar.gz
river-5bec8f4fcb361d3c7527d367bc66c0810e3c91d9.tar.xz
Only store mapped views in the view stack
Diffstat (limited to 'src/Server.zig')
-rw-r--r--src/Server.zig11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Server.zig b/src/Server.zig
index 944f297..8639233 100644
--- a/src/Server.zig
+++ b/src/Server.zig
@@ -190,7 +190,10 @@ fn handleNewXdgSurface(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) v
Log.Debug.log("New xdg_toplevel", .{});
- self.input_manager.default_seat.focused_output.addView(wlr_xdg_surface) catch unreachable;
+ // The View will add itself to the output's view stack on map
+ const output = self.input_manager.default_seat.focused_output;
+ const node = self.allocator.create(ViewStack(View).Node) catch unreachable;
+ node.view.init(output, output.current_focused_tags, wlr_xdg_surface);
}
/// This event is raised when the layer_shell recieves a new surface from a client.
@@ -261,5 +264,9 @@ fn handleNewXwaylandSurface(listener: ?*c.wl_listener, data: ?*c_void) callconv(
"New xwayland surface: title '{}', class '{}'",
.{ wlr_xwayland_surface.title, wlr_xwayland_surface.class },
);
- self.input_manager.default_seat.focused_output.addView(wlr_xwayland_surface) catch unreachable;
+
+ // The View will add itself to the output's view stack on map
+ const output = self.input_manager.default_seat.focused_output;
+ const node = self.allocator.create(ViewStack(View).Node) catch unreachable;
+ node.view.init(output, output.current_focused_tags, wlr_xwayland_surface);
}