i3 - improved tiling WM


unhide hidden i3bar when mode is active

Patch status: needinfo

Patch by jj

Long description:

A patch of mine just got merged, but I was reported that this does not solve the problem for everyone. 

Because I have set my i3bar modifier to another key than the i3 modifier, I overlooked that the bar could unhide when you release the i3bar modifier key directly after activating a new mode. This happens, e.g., when the mode was activated by pressing the i3bar modifier, which would then be released and would directly hide the bar again   

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

b/i3bar/src/xcb.c

17
@@ -80,6 +80,9 @@ ev_io      *xkb_io;
18
 /* The name of current binding mode */
19
 static mode binding;
20
 
21
+/* Indicates whether a new binding mode was recently activated */
22
+bool activated_mode = false;
23
+
24
 /* The parsed colors */
25
 struct xcb_colors_t {
26
     uint32_t bar_fg;
27
@@ -873,8 +876,10 @@ void xkb_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) {
28
 
29
     if (modstate != mod_pressed) {
30
         if (modstate == 0) {
31
-            DLOGMOD(config.modifier, released, hide_bars);
32
+            if (!activated_mode)
33
+                DLOGMOD(config.modifier, released, hide_bars);
34
         } else {
35
+            activated_mode = false;
36
             DLOGMOD(config.modifier, pressed, unhide_bars);
37
         }
38
         mod_pressed = modstate;
39
@@ -1752,5 +1757,6 @@ void redraw_bars(void) {
40
 void set_current_mode(struct mode *current) {
41
     I3STRING_FREE(binding.name);
42
     binding = *current;
43
+    activated_mode = binding.name;
44
     return;
45
 }