From 585d1633fb67f69eff7fb72d7cd29c58991da20f Mon Sep 17 00:00:00 2001 From: krypt-n Date: Tue, 25 Nov 2014 13:16:01 +0100 Subject: [PATCH] Fixes everything being red --- bar.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bar.c b/bar.c index 3625533..3690afe 100644 --- a/bar.c +++ b/bar.c @@ -124,9 +124,9 @@ update_gc (void) }); XftColorFree(dpy, visual_ptr, colormap , &sel_fg); - char color[8] = "#ffffff"; - snprintf(color, sizeof(color), "#%06X", fgc); - + char color[] = "#ffffff"; + uint32_t nfgc = fgc & 0x00ffffff; + snprintf(color, sizeof(color), "#%06X", nfgc); if (!XftColorAllocName (dpy, visual_ptr, colormap, color, &sel_fg)) { fprintf(stderr, "Couldn't allocate xft font color '%s'\n", color); } @@ -1102,8 +1102,9 @@ init (void) xcb_map_window(c, mon->window); } - char color[8] = "#ffffff"; - snprintf(color, sizeof(color), "#%06X", fgc); + char color[] = "#ffffff"; + uint32_t nfgc = fgc & 0x00ffffff; + snprintf(color, sizeof(color), "#%06X", nfgc); if (!XftColorAllocName (dpy, visual_ptr, colormap, color, &sel_fg)) { fprintf(stderr, "Couldn't allocate xft font color '%s'\n", color); @@ -1296,7 +1297,6 @@ main (int argc, char **argv) break; } } - /* Copy the geometry values in place */ bw = geom_v[0]; bh = geom_v[1]; @@ -1307,7 +1307,6 @@ main (int argc, char **argv) init(); /* Get the fd to Xserver */ pollin[1].fd = xcb_get_file_descriptor(c); - for (;;) { bool redraw = false;