From eef3fdb452cc196713e2d6c4350e6d105f28e1c6 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 30 Sep 2010 12:48:24 +0200 Subject: [PATCH] Add variables for tracking some X11 defaults Signed-off-by: Uli Schlachter --- awesome.c | 2 ++ globalconf.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/awesome.c b/awesome.c index d05af4ae..a74cdb3b 100644 --- a/awesome.c +++ b/awesome.c @@ -359,6 +359,8 @@ main(int argc, char **argv) fatal("cannot open display"); globalconf.screen = xcb_aux_get_screen(globalconf.connection, globalconf.default_screen); + 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); diff --git a/globalconf.h b/globalconf.h index b833f2bf..481aa0bc 100644 --- a/globalconf.h +++ b/globalconf.h @@ -115,6 +115,10 @@ typedef struct xcb_screen_t *screen; /** A graphic context. */ xcb_gcontext_t gc; + /** Our default depth */ + uint8_t default_depth; + /** Our default color map */ + xcb_colormap_t default_cmap; } awesome_t; extern awesome_t globalconf;