bug fix: XClassHint not copied correctly

Thanks Nikos Ntarmos <ntarmos@ceid.upatras.gr>
This commit is contained in:
Julien Danjou 2007-09-28 10:46:34 +02:00
parent 30c9d74dd2
commit ab738c9cab
1 changed files with 5 additions and 4 deletions

9
tag.c
View File

@ -67,13 +67,14 @@ applyrules(Client * c, awesome_config *awesomeconf)
XClassHint ch = { 0, 0 }; XClassHint ch = { 0, 0 };
char *prop; char *prop;
len += a_strlen(ch.res_class) + a_strlen(ch.res_name) + a_strlen(c->name); XGetClassHint(c->display, c->win, &ch);
prop = p_new(char, len + 1); len = a_strlen(ch.res_class) + a_strlen(ch.res_name) + a_strlen(c->name);
prop = p_new(char, len + 3);
/* rule matching */ /* rule matching */
XGetClassHint(c->display, c->win, &ch); snprintf(prop, len + 3, "%s:%s:%s",
snprintf(prop, len + 1, "%s:%s:%s",
ch.res_class ? ch.res_class : "", ch.res_name ? ch.res_name : "", c->name); ch.res_class ? ch.res_class : "", ch.res_name ? ch.res_name : "", c->name);
for(i = 0; i < awesomeconf->nrules; i++) for(i = 0; i < awesomeconf->nrules; i++)
if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0))