From 13377b4e34be6d298eeb41a55df939f39ee7f5a7 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Wed, 18 Mar 2020 19:47:55 +0100 Subject: Calculate colors using the client's visual and colormap As cwm was using the screen's default visual and colormap to draw all client borders, borders for windows that had a depth of 32 bits were not rendered correctly. The same happened with text in the popup menus which were recently changed to be drawn in the context of the client. This commit introduces a Visual reference for each client, and allocates all potential colors for a client's specific visual and colormap in the client_ctx struct. These colors are then used to draw client borders and popup menus. Additionally, since we touch the drawing code anyway, borders are reintroduced to the popup menus for better contrast. --- kbfunc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kbfunc.c') diff --git a/kbfunc.c b/kbfunc.c index 1ce473e..c68aa8c 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -167,7 +167,7 @@ kbfunc_client_move_mb(void *ctx, struct cargs *cargs) CurrentTime) != GrabSuccess) return; - screen_prop_win_create(sc, cc->win); + screen_prop_win_create(sc, cc); screen_prop_win_draw(sc, "%+5d%+5d", cc->geom.x, cc->geom.y); while (move) { XMaskEvent(X_Dpy, MOUSEMASK, &ev); @@ -256,7 +256,7 @@ kbfunc_client_resize_mb(void *ctx, struct cargs *cargs) CurrentTime) != GrabSuccess) return; - screen_prop_win_create(sc, cc->win); + screen_prop_win_create(sc, cc); screen_prop_win_draw(sc, "%4d x %-4d", cc->dim.w, cc->dim.h); while (resize) { XMaskEvent(X_Dpy, MOUSEMASK, &ev); -- cgit v1.2.3-2-gb3c3