i3 - improved tiling WM


i3bar: Fix pixel offset calculation in dual-head

Patch status: superseded

Patch by Thomas Adam

Long description:

When running i3bar on a dual-head display with workspaces enabled in i3bar's
config, the second monitor wouldn't use a correct x position offset and
would draw its label too close to the screen's edge.  In comparison to the
first monitor, this is inconsistent because that starts with a pixel offset
of 1.

To apply this patch, use:
curl http://cr.i3wm.org/patch/160/raw.patch | git am

b/i3bar/src/xcb.c

18
@@ -1557,7 +1557,7 @@ void reconfig_windows(void) {
19
  */
20
 void draw_bars(bool unhide) {
21
     DLOG("Drawing Bars...\n");
22
-    int i = 1;
23
+    int i = 0;
24
 
25
     refresh_statusline();
26
 
27
@@ -1621,6 +1621,7 @@ void draw_bars(bool unhide) {
28
 
29
         i3_ws *ws_walk;
30
 
31
+	i++;
32
         TAILQ_FOREACH(ws_walk, outputs_walk->workspaces, tailq) {
33
             DLOG("Drawing Button for WS %s at x = %d, len = %d\n", i3string_as_utf8(ws_walk->name), i, ws_walk->name_width);
34
             uint32_t fg_color = colors.inactive_ws_fg;