From d91d36c69c36293be72ba53a61244ef8221ce1e5 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 26 Mar 2014 14:29:02 +0100 Subject: [PATCH] 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 --- lib/awful/tag.lua.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in index 2273d473..201e909c 100644 --- a/lib/awful/tag.lua.in +++ b/lib/awful/tag.lua.in @@ -530,7 +530,12 @@ function tag.withcurrent(c) if #tags == 0 then tags = tag.selectedlist(c.screen) end - c:tags(tags) + if #tags == 0 then + tags = tag.gettags(c.screen) + end + if #tags ~= 0 then + c:tags(tags) + end end local function attached_connect_signal_screen(screen, sig, func)