From 02910145c8c3b484908fdd67ea665344a303e393 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sat, 28 Mar 2020 14:47:50 +0100 Subject: [PATCH] Add new views to the top of the stack --- src/root.zig | 2 +- src/view.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/root.zig b/src/root.zig index 473eb2d..b6f928e 100644 --- a/src/root.zig +++ b/src/root.zig @@ -67,7 +67,7 @@ pub const Root = struct { pub fn addView(self: *Self, wlr_xdg_surface: *c.wlr_xdg_surface) void { const node = self.views.allocateNode(self.server.allocator) catch unreachable; node.data.init(self, wlr_xdg_surface); - self.unmapped_views.append(node); + self.unmapped_views.prepend(node); } /// Finds the topmost view under the output layout coordinates lx, ly diff --git a/src/view.zig b/src/view.zig index f34f015..e8d882d 100644 --- a/src/view.zig +++ b/src/view.zig @@ -109,7 +109,7 @@ pub const View = struct { const node = @fieldParentPtr(std.TailQueue(View).Node, "data", view); view.root.unmapped_views.remove(node); - view.root.views.append(node); + view.root.views.prepend(node); view.root.arrange(); }