]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus_cycle_indicator.c
freeze onscreen stacking order changes while a temp raise for focus cycling is occuring
[chaz/openbox] / openbox / focus_cycle_indicator.c
index 203a85ff92170c453e3549de246c6d81c218959b..5a6a1029efc1a0d1c44d6cf236709aa4930f694b 100644 (file)
@@ -39,6 +39,7 @@ struct
 
 static RrAppearance *a_focus_indicator;
 static RrColor      *color_white;
+static gboolean      visible;
 
 static Window create_window(Window parent, gulong mask,
                             XSetWindowAttributes *attrib)
@@ -46,13 +47,15 @@ static Window create_window(Window parent, gulong mask,
     return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0,
                          RrDepth(ob_rr_inst), InputOutput,
                          RrVisual(ob_rr_inst), mask, attrib);
-                       
+
 }
 
 void focus_cycle_indicator_startup(gboolean reconfig)
 {
     XSetWindowAttributes attr;
 
+    visible = FALSE;
+
     if (reconfig) return;
 
     focus_indicator.top.obwin.type = Window_Internal;
@@ -118,7 +121,7 @@ void focus_cycle_indicator_shutdown(gboolean reconfig)
 
 void focus_cycle_draw_indicator(ObClient *c)
 {
-    if (!c) {
+    if (!c && visible) {
         gulong ignore_start;
 
         /* kill enter events cause by this unmapping */
@@ -130,7 +133,10 @@ void focus_cycle_draw_indicator(ObClient *c)
         XUnmapWindow(ob_display, focus_indicator.bottom.win);
 
         event_end_ignore_all_enters(ignore_start);
-    } else {
+
+        visible = FALSE;
+    }
+    else if (c) {
         /*
           if (c)
               frame_adjust_focus(c->frame, FALSE);
@@ -167,7 +173,7 @@ void focus_cycle_draw_indicator(ObClient *c)
         RrPaint(a_focus_indicator, focus_indicator.top.win,
                 w, h);
 
-        x = c->area.x;
+        x = c->frame->area.x;
         y = c->frame->area.y;
         w = wl;
         h = c->frame->area.height;
@@ -249,5 +255,7 @@ void focus_cycle_draw_indicator(ObClient *c)
         XMapWindow(ob_display, focus_indicator.left.win);
         XMapWindow(ob_display, focus_indicator.right.win);
         XMapWindow(ob_display, focus_indicator.bottom.win);
+
+        visible = TRUE;
     }
 }
This page took 0.02175 seconds and 4 git commands to generate.