awful.tag.withcurrent: Try harder at finding a tag (FS#1196)
When a screen doesn't have any tags selected, then just tag the new client with all of the screen's tags. That way, we don't lose clients. Also, if we failed at coming up with tags for a client, don't completely untag it. This means that it can keep its old tags if it had any. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
eed605bf7f
commit
d91d36c69c
|
@ -530,8 +530,13 @@ function tag.withcurrent(c)
|
||||||
if #tags == 0 then
|
if #tags == 0 then
|
||||||
tags = tag.selectedlist(c.screen)
|
tags = tag.selectedlist(c.screen)
|
||||||
end
|
end
|
||||||
|
if #tags == 0 then
|
||||||
|
tags = tag.gettags(c.screen)
|
||||||
|
end
|
||||||
|
if #tags ~= 0 then
|
||||||
c:tags(tags)
|
c:tags(tags)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function attached_connect_signal_screen(screen, sig, func)
|
local function attached_connect_signal_screen(screen, sig, func)
|
||||||
capi.tag.connect_signal(sig, function(_tag, ...)
|
capi.tag.connect_signal(sig, function(_tag, ...)
|
||||||
|
|
Loading…
Reference in New Issue