From 371536a396873af0a6c75c2bf09effbb898e73fa Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 4 Oct 2010 09:24:17 +0200 Subject: [PATCH] Create a temporary window for globalconf.gc We don't have any window with globalconf.depth yet at this point, so we have to create one just for setting up our GC. Signed-off-by: Uli Schlachter --- awesome.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/awesome.c b/awesome.c index 6df2f02c7..e24002595 100644 --- a/awesome.c +++ b/awesome.c @@ -464,9 +464,22 @@ main(int argc, char **argv) /* The default GC is just a newly created associated with a window with * depth globalconf.default_depth */ + xcb_window_t tmp_win = xcb_generate_id(globalconf.connection); globalconf.gc = xcb_generate_id(globalconf.connection); - xcb_create_gc(globalconf.connection, globalconf.gc, globalconf.systray.window, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND, + xcb_create_window(globalconf.connection, globalconf.default_depth, + tmp_win, globalconf.screen->root, + -1, -1, 1, 1, 0, + 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 + }); + xcb_create_gc(globalconf.connection, globalconf.gc, tmp_win, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND, (const uint32_t[]) { globalconf.screen->black_pixel, globalconf.screen->white_pixel }); + xcb_destroy_window(globalconf.connection, tmp_win); /* Parse and run configuration file */ if (!luaA_parserc(&xdg, confpath, true))