wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 5a2a5d41b524b1c25dc29ddbecb919302a618fa9
parent 69b59ade71bfa282f8b27501c00facd106eb1139
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Tue, 11 Apr 2006 14:23:13 +0200

fixed two bugs reported by nion and lavish


Diffstat:
cmd/wm/bar.c | 3++-
cmd/wm/client.c | 2+-
cmd/wm/rule.c | 32++++++++++++++++++++++++++------
cmd/wm/view.c | 9---------
cmd/wm/wm.h | 2+-
config.mk | 2+-
rc/welcome | 2+-
7 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/cmd/wm/bar.c b/cmd/wm/bar.c @@ -64,7 +64,8 @@ destroy_label(Label *l) unsigned int bar_height() { - return xfont->ascent + xfont->descent + 4; + enum { BAR_PADDING = 4 }; + return xfont->ascent + xfont->descent + BAR_PADDING; } void diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -333,7 +333,7 @@ manage_client(Client *c) if(c->trans && (trans = win2client(c->trans))) cext_strlcpy(c->tags, trans->tags, sizeof(c->tags)); else - match_tags(c, True); + match_tags(c); reparent_client(c, c->framewin, c->rect.x, c->rect.y); update_views(c); diff --git a/cmd/wm/rule.c b/cmd/wm/rule.c @@ -99,7 +99,7 @@ update_rules() static void -match(Client *c, const char *prop, Bool newclient) +match(Client *c, const char *prop) { unsigned int i; regmatch_t tmpregm; @@ -110,8 +110,19 @@ match(Client *c, const char *prop, Bool newclient) if(!strncmp(r->tags, "~", 2)) c->floating = True; else if(!strncmp(r->tags, "!", 2)) { - if(view.size && newclient) - cext_strlcpy(c->tags, view.data[sel]->name, sizeof(c->tags)); + if(view.size) { + if(c->view.size) { + c->tags[0] = 0; + unsigned int j; + for(j = 0; j < c->view.size; j++) { + cext_strlcat(c->tags, c->view.data[j]->name, sizeof(c->tags)); + if(j + 1 < c->view.size) + cext_strlcat(c->tags, "+", sizeof(c->tags)); + } + } + else + cext_strlcpy(c->tags, view.data[sel]->name, sizeof(c->tags)); + } } else cext_strlcpy(c->tags, r->tags, sizeof(c->tags)); @@ -120,14 +131,23 @@ match(Client *c, const char *prop, Bool newclient) } void -match_tags(Client *c, Bool newclient) +match_tags(Client *c) { if(!def.rules) goto Fallback; - match(c, c->name, newclient); - match(c, c->classinst, newclient); + match(c, c->name); + match(c, c->classinst); Fallback: if(!strlen(c->tags)) cext_strlcpy(c->tags, "nil", sizeof(c->tags)); } + +void +retag() +{ + unsigned int i; + for(i = 0; i < client.size; i++) + match_tags(client.data[i]); + update_views(); +} diff --git a/cmd/wm/view.c b/cmd/wm/view.c @@ -369,12 +369,3 @@ update_views() else update_bar_tags(); } - -void -retag() -{ - unsigned int i; - for(i = 0; i < client.size; i++) - match_tags(client.data[i], False); - update_views(); -} diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h @@ -258,7 +258,7 @@ void ungrab_mouse(Window w, unsigned long mod, unsigned int button); /* rule.c */ void update_rules(); -void match_tags(Client *c, Bool newclient); +void match_tags(Client *c); /* view.c */ void arrange_view(View *v, Bool dirty); diff --git a/config.mk b/config.mk @@ -8,7 +8,7 @@ MANPREFIX = ${PREFIX}/share/man X11INC = /usr/X11R6/include X11LIB = /usr/X11R6/lib -VERSION = 20060411 +VERSION = 3-current # includes and libs LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11 diff --git a/rc/welcome b/rc/welcome @@ -42,7 +42,7 @@ Let's go! will show you the content of the bar. We hope that these steps gave you an idea of how wmii works. You can reread -them at any time by pressing $MODKEY-Control-a and selecting 'welcome'. +them at any time by pressing $MODKEY-a and selecting 'welcome'. You should now take a look at the wmii(1) man page. An FAQ is available on <http://wmii.de>.