fix adjust_visibility (#166)

This commit is contained in:
Nooo37 2022-05-10 17:47:38 +02:00 committed by GitHub
parent bc980b7dfe
commit c20aa6daea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 22 deletions

View File

@ -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 -- Change visibility of the tab bar when layout, selected tag or number of clients (visible, master, slave) changes
local function adjust_visiblity(t) local function adjust_visibility()
s.tabbar.visible = (#t:clients() - t.master_count > 1) local name = awful.layout.getname( awful.layout.get( s ) )
and (t.layout.name == mylayout.name) s.tabbar.visible = (name == mylayout.name)
end end
tag.connect_signal("property::selected", function(t) tag.connect_signal("property::selected", adjust_visibility)
adjust_visiblity(t) tag.connect_signal("property::layout", adjust_visibility)
end) tag.connect_signal("tagged", adjust_visibility)
tag.connect_signal("property::layout", function(t, layout) tag.connect_signal("untagged", adjust_visibility)
adjust_visiblity(t) tag.connect_signal("property::master_count", adjust_visibility)
end) client.connect_signal("property::minimized", adjust_visibility)
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)
end end
-- update the tabbar size and position (to support gap size change on the fly) -- update the tabbar size and position (to support gap size change on the fly)