diff options
author | Wynn Wolf Arbor | 2020-03-18 19:47:55 +0100 |
---|---|---|
committer | Wolfgang Müller | 2021-04-27 12:28:35 +0200 |
commit | 13377b4e34be6d298eeb41a55df939f39ee7f5a7 (patch) | |
tree | 6db3350aafcb6156361550436dfddb93c2f104d1 /screen.c | |
parent | 5ff1dc2b8f6ec0ab2ebdd132ba1b56cebeb9626c (diff) | |
download | cwm-13377b4e34be6d298eeb41a55df939f39ee7f5a7.tar.gz |
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.
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -265,13 +265,13 @@ screen_assert_clients_within(struct screen_ctx *sc) } void -screen_prop_win_create(struct screen_ctx *sc, Window win) +screen_prop_win_create(struct screen_ctx *sc, struct client_ctx *cc) { - sc->prop.win = XCreateSimpleWindow(X_Dpy, win, 0, 0, 1, 1, 0, - sc->xftcolor[CWM_COLOR_MENU_BG].pixel, - sc->xftcolor[CWM_COLOR_MENU_BG].pixel); + sc->prop.win = XCreateSimpleWindow(X_Dpy, cc->win, 0, 0, 1, 1, Conf.bwidth, + cc->xftcolor[CWM_COLOR_MENU_FG].pixel, + cc->xftcolor[CWM_COLOR_MENU_BG].pixel); sc->prop.xftdraw = XftDrawCreate(X_Dpy, sc->prop.win, - sc->visual, sc->colormap); + cc->visual, cc->colormap); XMapWindow(X_Dpy, sc->prop.win); } |