dwm.c
changeset 1197 b9bb1d036bd0
parent 1196 58a67fab8143
child 1198 0c051f7b88e6
equal deleted inserted replaced
1196:58a67fab8143 1197:b9bb1d036bd0
   238 
   238 
   239 /* function implementations */
   239 /* function implementations */
   240 
   240 
   241 void
   241 void
   242 applyrules(Client *c) {
   242 applyrules(Client *c) {
   243 	unsigned int i;
   243 	unsigned int i, j;
   244 	Bool matched = False;
   244 	Bool matched = False;
   245 	Rule *r;
   245 	Rule *r;
   246 	XClassHint ch = { 0 };
   246 	XClassHint ch = { 0 };
   247 
   247 
   248 	/* rule matching */
   248 	/* rule matching */
   252 		if((!r->title || strstr(c->name, r->title))
   252 		if((!r->title || strstr(c->name, r->title))
   253 		&& (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
   253 		&& (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
   254 		&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
   254 		&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
   255 			c->isfloating = r->isfloating;
   255 			c->isfloating = r->isfloating;
   256 			if(r->tag) {
   256 			if(r->tag) {
   257 				c->tags[idxoftag(r->tag)] = True;
   257 				if(r->tag[0] == '*' && r->tag[1] == 0)
       
   258 					for(j = 0; j < LENGTH(tags); i++)
       
   259 						c->tags[j] = True;
       
   260 				else
       
   261 					c->tags[idxoftag(r->tag)] = True;
   258 				matched = True;
   262 				matched = True;
   259 			}
   263 			}
   260 		}
   264 		}
   261 	}
   265 	}
   262 	if(ch.res_class)
   266 	if(ch.res_class)