From: Axel Wagner Date: Sun, 20 Mar 2011 18:49:59 +0000 (+0100) Subject: Collapse two ChangeGC-calls (thx sECuRE) X-Git-Tag: 4.0.1~7^2~3^2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ba748d72ff6c60b3eb0696151d083563807967ca;p=i3%2Fi3 Collapse two ChangeGC-calls (thx sECuRE) --- diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 96dbe12e..87d0c85b 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -958,14 +958,12 @@ void draw_bars() { /* The urgent-hint should get noticed, so we unhide the bars shortly */ unhide_bars(); } + uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND; + uint32_t vals[] = { bg_color, bg_color }; xcb_change_gc(xcb_connection, outputs_walk->bargc, - XCB_GC_FOREGROUND, - &bg_color); - xcb_change_gc(xcb_connection, - outputs_walk->bargc, - XCB_GC_BACKGROUND, - &bg_color); + mask, + vals); xcb_rectangle_t rect = { i + 1, 1, ws_walk->name_width + 8, font_height + 4 }; xcb_poly_fill_rectangle(xcb_connection, outputs_walk->buffer,