commit 3dddff5ce848243248646513ebd31bda1b4a4a1d
parent 28e98219e0b9704b4bc4c685e36c1bb2c12834db
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Thu, 9 Mar 2006 11:53:53 +0100
added Georg's proposal to select a tag implicitely if a new client appeares with a different tag and the current tag is empty
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -332,6 +332,18 @@ manage_client(Client *c)
t = ntag ? tag[sel] : alloc_tag(def.tag);
cext_strlcat(c->tags, tc && strlen(tc->tags) ? tc->tags : t->name, sizeof(c->tags));
update_tags();
+
+ /* shorthand proposed by Georg Neis */
+ if(!sel_client_of_tag(t)) {
+ /* consider removing the empty tag page instead */
+ char ct[256];
+ char *p;
+
+ cext_strlcpy(ct, tc && strlen(tc->tags) ? tc->tags : t->name, sizeof(ct));
+ if((p = strchr(ct, ' ')))
+ *p = 0;
+ select_tag(ct);
+ }
}
void