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:
Uli Schlachter 2014-03-26 14:29:02 +01:00
parent eed605bf7f
commit d91d36c69c
1 changed files with 6 additions and 1 deletions

View File

@ -530,7 +530,12 @@ 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)