From a63fb461ba495d258c2acc39735d02da88895a89 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 5 Jun 2020 00:02:55 +0200 Subject: [PATCH] river-status: send view_tags on view map/unmap --- river/Output.zig | 5 +++++ river/Root.zig | 5 +---- river/View.zig | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/river/Output.zig b/river/Output.zig index 09e1168..d97ebfb 100644 --- a/river/Output.zig +++ b/river/Output.zig @@ -180,6 +180,11 @@ pub fn getRenderer(self: Self) *c.wlr_renderer { return c.river_wlr_backend_get_renderer(self.wlr_output.backend); } +pub fn sendViewTags(self: Self) void { + var it = self.status_trackers.first; + while (it) |node| : (it = node.next) node.data.sendViewTags(); +} + const MasterPosition = enum { Top, Right, diff --git a/river/Root.zig b/river/Root.zig index 2b229b0..d4a22b1 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -246,10 +246,7 @@ fn commitTransaction(self: *Self) void { view.dropStashedBuffer(); } - if (view_tags_changed) { - var it = output.status_trackers.first; - while (it) |node| : (it = node.next) node.data.sendViewTags(); - } + if (view_tags_changed) output.sendViewTags(); } // Iterate over all seats and update focus diff --git a/river/View.zig b/river/View.zig index 7929673..b67b902 100644 --- a/river/View.zig +++ b/river/View.zig @@ -248,6 +248,8 @@ pub fn map(self: *Self) void { c.wlr_surface_send_enter(self.wlr_surface.?, self.output.wlr_output); + self.output.sendViewTags(); + root.arrange(); } @@ -268,6 +270,8 @@ pub fn unmap(self: *Self) void { const node = @fieldParentPtr(ViewStack(Self).Node, "view", self); self.output.views.remove(node); + self.output.sendViewTags(); + root.arrange(); }