Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
added wild-card handling for tags
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
009118d
..
b86ba94
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-240,7
+240,7
@@
Window root, barwin;
void
applyrules(Client *c) {
void
applyrules(Client *c) {
- unsigned int i;
+ unsigned int i
, j
;
Bool matched = False;
Rule *r;
XClassHint ch = { 0 };
Bool matched = False;
Rule *r;
XClassHint ch = { 0 };
@@
-254,7
+254,11
@@
applyrules(Client *c) {
&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
c->isfloating = r->isfloating;
if(r->tag) {
&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
c->isfloating = r->isfloating;
if(r->tag) {
- c->tags[idxoftag(r->tag)] = True;
+ if(r->tag[0] == '*' && r->tag[1] == 0)
+ for(j = 0; j < LENGTH(tags); i++)
+ c->tags[j] = True;
+ else
+ c->tags[idxoftag(r->tag)] = True;
matched = True;
}
}
matched = True;
}
}
@@
-504,7
+508,7
@@
void
detachstack(Client *c) {
Client **tc;
detachstack(Client *c) {
Client **tc;
- for(tc
=&stack; *tc && *tc != c; tc=
&(*tc)->snext);
+ for(tc
= &stack; *tc && *tc != c; tc =
&(*tc)->snext);
*tc = c->snext;
}
*tc = c->snext;
}
@@
-1162,8
+1166,7
@@
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
/* adjust for aspect limits */
if(c->minax != c->maxax && c->minay != c->maxay
/* adjust for aspect limits */
if(c->minax != c->maxax && c->minay != c->maxay
- && c->minax > 0 && c->maxax > 0 && c->minay > 0 && c->maxay > 0)
- {
+ && c->minax > 0 && c->maxax > 0 && c->minay > 0 && c->maxay > 0) {
if(w * c->maxay > h * c->maxax)
w = h * c->maxax / c->maxay;
else if(w * c->minay < h * c->minax)
if(w * c->maxay > h * c->maxax)
w = h * c->maxax / c->maxay;
else if(w * c->minay < h * c->minax)
@@
-1532,7
+1535,7
@@
tag(const char *arg) {
if(!sel)
return;
for(i = 0; i < LENGTH(tags); i++)
if(!sel)
return;
for(i = 0; i < LENGTH(tags); i++)
- sel->tags[i] = (
NULL == arg
);
+ sel->tags[i] = (
arg == NULL
);
sel->tags[idxoftag(arg)] = True;
arrange();
}
sel->tags[idxoftag(arg)] = True;
arrange();
}