tag.c
changeset 742 39b941868ce3
parent 644 1ed8c40dde36
child 757 22dfaeb82491
equal deleted inserted replaced
741:7c5d5b1e49c9 742:39b941868ce3
    74 settags(Client *c, Client *trans) {
    74 settags(Client *c, Client *trans) {
    75 	char prop[512];
    75 	char prop[512];
    76 	unsigned int i, j;
    76 	unsigned int i, j;
    77 	regmatch_t tmp;
    77 	regmatch_t tmp;
    78 	Bool matched = trans != NULL;
    78 	Bool matched = trans != NULL;
    79 	XClassHint ch;
    79 	XClassHint ch = { 0 };
    80 
    80 
    81 	if(matched) {
    81 	if(matched) {
    82 		for(i = 0; i < ntags; i++)
    82 		for(i = 0; i < ntags; i++)
    83 			c->tags[i] = trans->tags[i];
    83 			c->tags[i] = trans->tags[i];
    84 	}
    84 	}
    85 	else if(XGetClassHint(dpy, c->win, &ch)) {
    85 	else {
       
    86 		XGetClassHint(dpy, c->win, &ch);
    86 		snprintf(prop, sizeof prop, "%s:%s:%s",
    87 		snprintf(prop, sizeof prop, "%s:%s:%s",
    87 				ch.res_class ? ch.res_class : "",
    88 				ch.res_class ? ch.res_class : "",
    88 				ch.res_name ? ch.res_name : "", c->name);
    89 				ch.res_name ? ch.res_name : "", c->name);
    89 		for(i = 0; i < len; i++)
    90 		for(i = 0; i < len; i++)
    90 			if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
    91 			if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {