From aca253420d98a69f9751e06121eec5f93ad95c80 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 30 Sep 2010 14:26:30 +0200 Subject: [PATCH] Make sure we set some required values on windows All windows which use globalconf.default_depth must also have a backpixel, borderpixel and colormap set when they are created. Without this, all these xcb_create_window() calls would fail when globalconf.default_depth is no longer the screen's default depth. Signed-off-by: Uli Schlachter --- objects/client.c | 6 ++++-- objects/wibox.c | 5 +++-- systray.c | 9 ++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/objects/client.c b/objects/client.c index 0161520ff..d0f3efa5a 100644 --- a/objects/client.c +++ b/objects/client.c @@ -432,7 +432,8 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, bool startup) wgeom->x, wgeom->y, wgeom->width, wgeom->height, wgeom->border_width, XCB_COPY_FROM_PARENT, globalconf.visual->visual_id, XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY - | XCB_CW_WIN_GRAVITY | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK, + | XCB_CW_WIN_GRAVITY | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK + | XCB_CW_COLORMAP, (const uint32_t []) { globalconf.colors.bg.pixel, @@ -440,7 +441,8 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, bool startup) XCB_GRAVITY_NORTH_WEST, XCB_GRAVITY_NORTH_WEST, 1, - FRAME_SELECT_INPUT_EVENT_MASK + FRAME_SELECT_INPUT_EVENT_MASK, + globalconf.default_cmap }); xcb_reparent_window(globalconf.connection, w, c->frame_window, 0, 0); xcb_map_window(globalconf.connection, w); diff --git a/objects/wibox.c b/objects/wibox.c index 043c56a9d..9e757538e 100644 --- a/objects/wibox.c +++ b/objects/wibox.c @@ -162,7 +162,7 @@ wibox_init(wibox_t *w) w->geometry.width, w->geometry.height, w->border_width, XCB_COPY_FROM_PARENT, globalconf.visual->visual_id, XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY - | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK, + | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP, (const uint32_t []) { w->ctx.bg.pixel, @@ -173,7 +173,8 @@ wibox_init(wibox_t *w) | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE - | XCB_EVENT_MASK_PROPERTY_CHANGE + | XCB_EVENT_MASK_PROPERTY_CHANGE, + globalconf.default_cmap }); /* Create a pixmap. */ diff --git a/systray.c b/systray.c index a86550acb..0c9accbee 100644 --- a/systray.c +++ b/systray.c @@ -46,7 +46,14 @@ systray_init(void) globalconf.systray.window, xscreen->root, -1, -1, 1, 1, 0, - XCB_COPY_FROM_PARENT, globalconf.visual->visual_id, 0, NULL); + XCB_COPY_FROM_PARENT, globalconf.visual->visual_id, + XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_COLORMAP, + (const uint32_t []) + { + globalconf.colors.bg.pixel, + globalconf.colors.bg.pixel, + globalconf.default_cmap + }); }