diff options
Diffstat (limited to '')
-rw-r--r-- | client.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -79,6 +79,7 @@ client_init(Window win, struct screen_ctx *sc) cc->geom.w = wattr.width; cc->geom.h = wattr.height; cc->colormap = wattr.colormap; + cc->visual = wattr.visual; cc->obwidth = wattr.border_width; cc->bwidth = Conf.bwidth; @@ -208,6 +209,10 @@ void client_remove(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; + unsigned int i; + + for (i = 0; i < CWM_COLOR_NITEMS; i++) + XftColorFree(X_Dpy, cc->visual, cc->colormap, &cc->xftcolor[i]); TAILQ_REMOVE(&sc->clientq, cc, entry); @@ -566,26 +571,25 @@ client_urgency(struct client_ctx *cc) void client_draw_border(struct client_ctx *cc) { - struct screen_ctx *sc = cc->sc; unsigned long pixel; if (cc->flags & CLIENT_ACTIVE) switch (cc->flags & CLIENT_HIGHLIGHT) { case CLIENT_GROUP: - pixel = sc->xftcolor[CWM_COLOR_BORDER_GROUP].pixel; + pixel = cc->xftcolor[CWM_COLOR_BORDER_GROUP].pixel; break; case CLIENT_UNGROUP: - pixel = sc->xftcolor[CWM_COLOR_BORDER_UNGROUP].pixel; + pixel = cc->xftcolor[CWM_COLOR_BORDER_UNGROUP].pixel; break; default: - pixel = sc->xftcolor[CWM_COLOR_BORDER_ACTIVE].pixel; + pixel = cc->xftcolor[CWM_COLOR_BORDER_ACTIVE].pixel; break; } else - pixel = sc->xftcolor[CWM_COLOR_BORDER_INACTIVE].pixel; + pixel = cc->xftcolor[CWM_COLOR_BORDER_INACTIVE].pixel; if (cc->flags & CLIENT_URGENCY) - pixel = sc->xftcolor[CWM_COLOR_BORDER_URGENCY].pixel; + pixel = cc->xftcolor[CWM_COLOR_BORDER_URGENCY].pixel; XSetWindowBorderWidth(X_Dpy, cc->win, (unsigned int)cc->bwidth); XSetWindowBorder(X_Dpy, cc->win, pixel); |