[awful] Add a check in toggletag
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
43fee02a5b
commit
cd825b36c0
11
awful.lua
11
awful.lua
|
@ -225,7 +225,16 @@ end
|
||||||
|
|
||||||
function client_toggletag(target, c)
|
function client_toggletag(target, c)
|
||||||
local sel = c or client.focus_get();
|
local sel = c or client.focus_get();
|
||||||
if sel then
|
local toggle = false
|
||||||
|
-- Count how many tags has the client
|
||||||
|
-- an only toggle tag if the client has at least one tag other than target
|
||||||
|
for k, v in ipairs(tag.get(sel:screen_get())) do
|
||||||
|
if target ~= v and sel:istagged(v) then
|
||||||
|
toggle = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if toggle and sel then
|
||||||
sel:tag(target, not sel:istagged(target))
|
sel:tag(target, not sel:istagged(target))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue