diff --git a/src/client.c b/src/client.c index 1fbf1f7..e1b893b 100644 --- a/src/client.c +++ b/src/client.c @@ -804,8 +804,8 @@ client_apply_rule(struct client *c) } /* Get _NET_WM_NAME */ - if(XGetWindowProperty(W->dpy, c->win, ATOM("_NET_WM_NAME"), 0, 0x77777777, false, - ATOM("UTF8_STRING"), &rf, &f, &n, &il, &data) + if(XGetWindowProperty(W->dpy, c->win, W->net_atom[net_wm_name], 0, 0x77777777, false, + W->net_atom[utf8_string], &rf, &f, &n, &il, &data) == Success && data) { wmname = xstrdup((char*)data); @@ -816,8 +816,8 @@ client_apply_rule(struct client *c) { if(s) { - FLAGAPPLY(flags, (xch.res_name && r->instance && !strcmp(xch.res_name, r->instance)), RINSTANCE); - FLAGAPPLY(flags, (xch.res_class && r->class && !strcmp(xch.res_class, r->class)), RCLASS); + FLAGAPPLY(flags, (xch.res_name && r->instance && !strcmp(xch.res_name, r->instance)), RINSTANCE); + FLAGAPPLY(flags, (xch.res_class && r->class && !strcmp(xch.res_class, r->class)), RCLASS); } FLAGAPPLY(flags, (wmname && r->name && !strcmp(wmname, r->name)), RNAME); diff --git a/src/wmfs.c b/src/wmfs.c index d3a63ed..4e64e11 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -433,23 +433,13 @@ wmfs_quit(void) t = SLIST_FIRST(&W->h.theme); SLIST_REMOVE_HEAD(&W->h.theme, next); XFreeFontSet(W->dpy, t->font.fontset); - free(t); - } - - while(!SLIST_EMPTY(&W->h.rule)) - { - r = SLIST_FIRST(&W->h.rule); - SLIST_REMOVE_HEAD(&W->h.rule, next); status_free_ctx(&t->tags_n_sl); status_free_ctx(&t->tags_s_sl); status_free_ctx(&t->tags_o_sl); + status_free_ctx(&t->tags_u_sl); status_free_ctx(&t->client_n_sl); status_free_ctx(&t->client_s_sl); - free(r->class); - free(r->instance); - free(r->role); - free(r->name); - free(r); + free(t); } while(!SLIST_EMPTY(&W->h.keybind)) @@ -460,6 +450,14 @@ wmfs_quit(void) free(k); } + while(!SLIST_EMPTY(&W->h.mousebind)) + { + m = SLIST_FIRST(&W->h.mousebind); + SLIST_REMOVE_HEAD(&W->h.mousebind, globnext); + free((void*)m->cmd); + free(m); + } + while(!SLIST_EMPTY(&W->h.launcher)) { l = SLIST_FIRST(&W->h.launcher); @@ -470,12 +468,15 @@ wmfs_quit(void) free(l); } - while(!SLIST_EMPTY(&W->h.mousebind)) + while(!SLIST_EMPTY(&W->h.rule)) { - m = SLIST_FIRST(&W->h.mousebind); - SLIST_REMOVE_HEAD(&W->h.mousebind, globnext); - free((void*)m->cmd); - free(m); + r = SLIST_FIRST(&W->h.rule); + SLIST_REMOVE_HEAD(&W->h.rule, next); + free(r->class); + free(r->instance); + free(r->role); + free(r->name); + free(r); } /* FIFO stuffs */