From 48c59fadfde5315b6cf90a2b657cf68267f8e463 Mon Sep 17 00:00:00 2001 From: eylles Date: Sun, 9 Jan 2022 03:01:52 -0600 Subject: [PATCH] use "hidden" property in the turn on/off helpers --- helpers/client.lua | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/helpers/client.lua b/helpers/client.lua index 0e14c51..b4bf040 100644 --- a/helpers/client.lua +++ b/helpers/client.lua @@ -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