From 0943667cdc5a86458c17ce6ce223c546cf86c7e6 Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 4 Jul 2012 02:14:18 -0400 Subject: [PATCH] convert bar_refresh() to XCB --- spectrwm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/spectrwm.c b/spectrwm.c index 20adaa4..5ea7095 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1822,8 +1822,8 @@ bar_toggle(struct swm_region *r, union arg *args) void bar_refresh(void) { - XSetWindowAttributes wa; struct swm_region *r; + uint32_t wa[2]; int i, num_screens; /* do this here because the conf file is in memory */ @@ -1855,18 +1855,15 @@ bar_refresh(void) } } - bzero(&wa, sizeof wa); num_screens = xcb_setup_roots_length(xcb_get_setup(conn)); for (i = 0; i < num_screens; i++) TAILQ_FOREACH(r, &screens[i].rl, entry) { if (r->bar == NULL) continue; - wa.border_pixel = - screens[i].c[SWM_S_COLOR_BAR_BORDER].color; - wa.background_pixel = - screens[i].c[SWM_S_COLOR_BAR].color; - XChangeWindowAttributes(display, r->bar->id, - CWBackPixel | CWBorderPixel, &wa); + wa[0] = screens[i].c[SWM_S_COLOR_BAR].color; + wa[1] = screens[i].c[SWM_S_COLOR_BAR_BORDER].color; + xcb_change_window_attributes(conn, r->bar->id, + XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL, wa); } bar_update(); } -- 1.7.10.4