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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-10-04 09:24:17 +02:00
parent e762a22f49
commit 371536a396
1 changed files with 14 additions and 1 deletions

View File

@ -464,9 +464,22 @@ main(int argc, char **argv)
/* The default GC is just a newly created associated with a window with /* The default GC is just a newly created associated with a window with
* depth globalconf.default_depth */ * depth globalconf.default_depth */
xcb_window_t tmp_win = xcb_generate_id(globalconf.connection);
globalconf.gc = 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 }); (const uint32_t[]) { globalconf.screen->black_pixel, globalconf.screen->white_pixel });
xcb_destroy_window(globalconf.connection, tmp_win);
/* Parse and run configuration file */ /* Parse and run configuration file */
if (!luaA_parserc(&xdg, confpath, true)) if (!luaA_parserc(&xdg, confpath, true))