made the class/instance fetching more failsafe

This commit is contained in:
Anselm R. Garbe 2006-03-10 15:52:49 +01:00
parent 61ad8e0f98
commit 4d7f8725ee
2 changed files with 19 additions and 3 deletions

View File

@ -39,9 +39,13 @@ alloc_client(Window w, XWindowAttributes *wa)
free(name.value);
}
if(XGetClassHint(dpy, c->win, &ch)) {
snprintf(c->classinst, sizeof(c->classinst), "%s:%s", ch.res_class, ch.res_name);
XFree(ch.res_class);
XFree(ch.res_name);
ch.res_class = ch.res_name = nil;
snprintf(c->classinst, sizeof(c->classinst), "%s:%s",
ch.res_class ? ch.res_class : "", ch.res_name ? ch.res_name : "");
if(ch.res_class)
XFree(ch.res_class);
if(ch.res_name)
XFree(ch.res_name);
}
fwa.override_redirect = 1;
fwa.background_pixmap = ParentRelative;

View File

@ -267,3 +267,15 @@ kid2index(unsigned short id)
return i;
return -1;
}
void
update_keys()
{
unsigned int i;
for(i = 0; i < nkey; i++) {
ungrab_key(key[i]);
grab_key(key[i]);
}
}