From c20aa6daea6b9887d2430ac9e62cb70514d23cbe Mon Sep 17 00:00:00 2001 From: Nooo37 <70270606+Nooo37@users.noreply.github.com> Date: Tue, 10 May 2022 17:47:38 +0200 Subject: [PATCH] fix adjust_visibility (#166) --- layout/mstab.lua | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/layout/mstab.lua b/layout/mstab.lua index 93ceb0e..88ce0cb 100644 --- a/layout/mstab.lua +++ b/layout/mstab.lua @@ -88,30 +88,17 @@ function update_tabbar( }) -- Change visibility of the tab bar when layout, selected tag or number of clients (visible, master, slave) changes - local function adjust_visiblity(t) - s.tabbar.visible = (#t:clients() - t.master_count > 1) - and (t.layout.name == mylayout.name) + local function adjust_visibility() + local name = awful.layout.getname( awful.layout.get( s ) ) + s.tabbar.visible = (name == mylayout.name) end - tag.connect_signal("property::selected", function(t) - adjust_visiblity(t) - end) - tag.connect_signal("property::layout", function(t, layout) - adjust_visiblity(t) - end) - tag.connect_signal("tagged", function(t, c) - adjust_visiblity(t) - end) - tag.connect_signal("untagged", function(t, c) - adjust_visiblity(t) - end) - tag.connect_signal("property::master_count", function(t) - adjust_visiblity(t) - end) - client.connect_signal("property::minimized", function(c) - local t = c.first_tag - adjust_visiblity(t) - end) + tag.connect_signal("property::selected", adjust_visibility) + tag.connect_signal("property::layout", adjust_visibility) + tag.connect_signal("tagged", adjust_visibility) + tag.connect_signal("untagged", adjust_visibility) + tag.connect_signal("property::master_count", adjust_visibility) + client.connect_signal("property::minimized", adjust_visibility) end -- update the tabbar size and position (to support gap size change on the fly)