]> git.sur5r.net Git - i3/i3/commitdiff
Collapse two ChangeGC-calls (thx sECuRE)
authorAxel Wagner <mail@merovius.de>
Sun, 20 Mar 2011 18:49:59 +0000 (19:49 +0100)
committerAxel Wagner <mail@merovius.de>
Sun, 20 Mar 2011 18:50:03 +0000 (19:50 +0100)
i3bar/src/xcb.c

index 96dbe12e17f48b91f81a19057ac9144a9a4ee0b7..87d0c85beb75e7e9307031f6f394ab2ed63e1896 100644 (file)
@@ -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,