use "hidden" property in the turn on/off helpers

This commit is contained in:
eylles 2022-01-09 03:01:52 -06:00
parent 338dba6292
commit 48c59fadfd
No known key found for this signature in database
GPG Key ID: 87BB13678A662E19
1 changed files with 3 additions and 19 deletions

View File

@ -7,17 +7,8 @@ local _client = {}
-- Remove current tag from window's tags
--
-- @param c A client
function _client.turn_off(c, current_tag)
if current_tag == nil then
current_tag = c.screen.selected_tag
end
local ctags = {}
for k, tag in pairs(c:tags()) do
if tag ~= current_tag then
table.insert(ctags, tag)
end
end
c:tags(ctags)
function _client.turn_off(c)
c.hidden = true
c.sticky = false
end
@ -25,14 +16,7 @@ end
--
-- @param c A client
function _client.turn_on(c)
local current_tag = c.screen.selected_tag
ctags = { current_tag }
for k, tag in pairs(c:tags()) do
if tag ~= current_tag then
table.insert(ctags, tag)
end
end
c:tags(ctags)
c.hidden = false
c:raise()
client.focus = c
end