Fix statusline context free

This commit is contained in:
Martin Duquesnoy 2012-01-27 14:00:29 +01:00
parent 02e48d1cd8
commit 86069d0a68
2 changed files with 22 additions and 21 deletions

View File

@ -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);

View File

@ -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 */