]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
make em saveunder
[chaz/openbox] / openbox / focus.c
index 2533f27efa29fbbffd65503244cdd6e815a5fe2e..947c05be00793dcea194db96732f443e0781c82e 100644 (file)
@@ -49,7 +49,6 @@ struct {
 } focus_indicator;
 
 RrAppearance *a_focus_indicator;
-RrColor *color_black;
 RrColor *color_white;
 
 static ObIconPopup *focus_cycle_popup;
@@ -87,33 +86,38 @@ void focus_startup(gboolean reconfig)
         focus_indicator.right.obwin.type = Window_Internal;
         focus_indicator.bottom.obwin.type = Window_Internal;
 
+        attr.save_under = True;
         attr.override_redirect = True;
         attr.background_pixel = BlackPixel(ob_display, ob_screen);
         focus_indicator.top.win =
             createWindow(RootWindow(ob_display, ob_screen),
-                         CWOverrideRedirect | CWBackPixel, &attr);
+                         CWOverrideRedirect | CWBackPixel | CWSaveUnder,
+                         &attr);
         focus_indicator.left.win =
             createWindow(RootWindow(ob_display, ob_screen),
-                         CWOverrideRedirect | CWBackPixel, &attr);
+                         CWOverrideRedirect | CWBackPixel | CWSaveUnder,
+                         &attr);
         focus_indicator.right.win =
             createWindow(RootWindow(ob_display, ob_screen),
-                         CWOverrideRedirect | CWBackPixel, &attr);
+                         CWOverrideRedirect | CWBackPixel | CWSaveUnder,
+                         &attr);
         focus_indicator.bottom.win =
             createWindow(RootWindow(ob_display, ob_screen),
-                         CWOverrideRedirect | CWBackPixel, &attr);
+                         CWOverrideRedirect | CWBackPixel | CWSaveUnder,
+                         &attr);
 
         stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.top));
         stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.left));
         stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.right));
         stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.bottom));
 
-        color_black = RrColorNew(ob_rr_inst, 0, 0, 0);
         color_white = RrColorNew(ob_rr_inst, 0xff, 0xff, 0xff);
 
         a_focus_indicator = RrAppearanceNew(ob_rr_inst, 4);
         a_focus_indicator->surface.grad = RR_SURFACE_SOLID;
         a_focus_indicator->surface.relief = RR_RELIEF_FLAT;
-        a_focus_indicator->surface.primary = color_black;
+        a_focus_indicator->surface.primary = RrColorNew(ob_rr_inst,
+                                                        0, 0, 0);
         a_focus_indicator->texture[0].type = RR_TEXTURE_LINE_ART;
         a_focus_indicator->texture[0].data.lineart.color = color_white;
         a_focus_indicator->texture[1].type = RR_TEXTURE_LINE_ART;
@@ -141,7 +145,6 @@ void focus_shutdown(gboolean reconfig)
         /* reset focus to root */
         XSetInputFocus(ob_display, PointerRoot, RevertToNone, event_lasttime);
 
-        RrColorFree(color_black);
         RrColorFree(color_white);
 
         RrAppearanceFree(a_focus_indicator);
@@ -523,17 +526,10 @@ void focus_cycle(gboolean forward, gboolean linear,
     ObClient *ft = NULL;
 
     if (cancel) {
-        /*
-        if (focus_cycle_target)
-            frame_adjust_focus(focus_cycle_target->frame, FALSE);
-        if (focus_client)
-            frame_adjust_focus(focus_client->frame, TRUE);
-        */
         focus_cycle_target = NULL;
         goto done_cycle;
-    } else if (done && dialog) {
+    } else if (done)
         goto done_cycle;
-    }
 
     if (!focus_order[screen_desktop])
         goto done_cycle;
@@ -591,15 +587,10 @@ void focus_directional_cycle(ObDirection dir,
     ObClient *ft = NULL;
 
     if (cancel) {
-        if (focus_cycle_target)
-            frame_adjust_focus(focus_cycle_target->frame, FALSE);
-        if (focus_client)
-            frame_adjust_focus(focus_client->frame, TRUE);
         focus_cycle_target = NULL;
         goto done_cycle;
-    } else if (done && dialog) {
+    } else if (done)
         goto done_cycle;
-    }
 
     if (!focus_order[screen_desktop])
         goto done_cycle;
@@ -619,10 +610,8 @@ void focus_directional_cycle(ObDirection dir,
         
     if (ft) {
         if (ft != focus_cycle_target) {/* prevents flicker */
-            if (focus_cycle_target)
-                frame_adjust_focus(focus_cycle_target->frame, FALSE);
             focus_cycle_target = ft;
-            frame_adjust_focus(focus_cycle_target->frame, TRUE);
+            focus_cycle_draw_indicator();
         }
     }
     if (focus_cycle_target) {
@@ -639,6 +628,7 @@ done_cycle:
     first = NULL;
     focus_cycle_target = NULL;
 
+    focus_cycle_draw_indicator();
     popup_cycle(ft, FALSE);
 
     return;
This page took 0.023781 seconds and 4 git commands to generate.