dwm.c
branchmerge
changeset 1349 56c2529afeab
parent 1348 18098673e417
child 1351 3f66d2d2cd6e
equal deleted inserted replaced
1348:18098673e417 1349:56c2529afeab
   248 	unsigned int i;
   248 	unsigned int i;
   249 	Rule *r;
   249 	Rule *r;
   250 	XClassHint ch = { 0 };
   250 	XClassHint ch = { 0 };
   251 
   251 
   252 	/* rule matching */
   252 	/* rule matching */
   253 	if(XGetClassHint(dpy, c->win, &ch) == 0)
   253 	if(XGetClassHint(dpy, c->win, &ch)) {
   254 		return;
   254 		for(i = 0; i < LENGTH(rules); i++) {
   255 	for(i = 0; i < LENGTH(rules); i++) {
   255 			r = &rules[i];
   256 		r = &rules[i];
   256 			if((!r->title || strstr(c->name, r->title))
   257 		if((!r->title || strstr(c->name, r->title))
   257 			&& (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
   258 		&& (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
   258 			&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
   259 		&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
   259 				c->isfloating = r->isfloating;
   260 			c->isfloating = r->isfloating;
   260 				c->tags |= r->tags & TAGMASK;
   261 			c->tags |= r->tags & TAGMASK;
   261 			}
   262 		}
   262 		}
   263 	}
   263 		if(ch.res_class)
   264 	if(ch.res_class)
   264 			XFree(ch.res_class);
   265 		XFree(ch.res_class);
   265 		if(ch.res_name)
   266 	if(ch.res_name)
   266 			XFree(ch.res_name);
   267 		XFree(ch.res_name);
   267 	}
   268 	if(!c->tags)
   268 	if(!c->tags)
   269 		c->tags = tagset[seltags];
   269 		c->tags = tagset[seltags];
   270 }
   270 }
   271 
   271 
   272 void
   272 void