From 8ea94154a6dee6548a4be5f984ea26d51064a44b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 30 Sep 2010 14:29:01 +0200 Subject: [PATCH] Associate our default GC with the systray window The window that is specified when a GC is created is used for two things. First, it specifies which protocol screen the GC should be associated with. Second, it specifies for which color depth the GC is valid. Due to this second property, we have to use the systray window instead of the root window. The systray window uses globalconf.default_depth. Signed-off-by: Uli Schlachter --- awesome.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/awesome.c b/awesome.c index b87e1c6e..6df2f02c 100644 --- a/awesome.c +++ b/awesome.c @@ -378,12 +378,6 @@ main(int argc, char **argv) globalconf.default_depth = globalconf.screen->root_depth; globalconf.default_cmap = globalconf.screen->default_colormap; - /* The default GC is just a newly created associated to the root window */ - globalconf.gc = xcb_generate_id(globalconf.connection); - xcb_create_gc(globalconf.connection, globalconf.gc, globalconf.screen->root, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND, - (const uint32_t[]) { globalconf.screen->black_pixel, globalconf.screen->white_pixel }); - - /* Prefetch all the extensions we might need */ xcb_prefetch_extension_data(globalconf.connection, &xcb_big_requests_id); xcb_prefetch_extension_data(globalconf.connection, &xcb_test_id); @@ -468,6 +462,12 @@ main(int argc, char **argv) /* init spawn (sn) */ spawn_init(); + /* The default GC is just a newly created associated with a window with + * depth globalconf.default_depth */ + globalconf.gc = xcb_generate_id(globalconf.connection); + xcb_create_gc(globalconf.connection, globalconf.gc, globalconf.systray.window, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND, + (const uint32_t[]) { globalconf.screen->black_pixel, globalconf.screen->white_pixel }); + /* Parse and run configuration file */ if (!luaA_parserc(&xdg, confpath, true)) fatal("couldn't find any rc file");