]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
really fix focus_last?
[chaz/openbox] / openbox / focus.c
index 2c8e58f446919c2dc8c0f672972c124ed16bbb3a..6a56c2f819bccd72ca767e866e1fe6ee64a94bc4 100644 (file)
@@ -249,7 +249,8 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
 
     old = focus_client;
 
-    if (type == OB_FOCUS_FALLBACK_UNFOCUSING && old) {
+    if ((type == OB_FOCUS_FALLBACK_UNFOCUSING
+         || type == OB_FOCUS_FALLBACK_CLOSED) && old) {
         if (old->transient_for) {
             gboolean trans = FALSE;
 
@@ -290,7 +291,9 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
         }
     }
 
-    if (config_focus_follow && !config_focus_last) {
+    if (config_focus_follow &&
+        (type == OB_FOCUS_FALLBACK_UNFOCUSING || !config_focus_last))
+    {
         if ((target = client_under_pointer()))
             if (client_normal(target) && client_can_focus(target))
                 return target;
@@ -320,7 +323,7 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
 
 void focus_fallback(ObFocusFallbackType type)
 {
-    ObClient *new = focus_fallback_target(type);
+    ObClient *new;
 
     /* unfocus any focused clients.. they can be focused by Pointer events
        and such, and then when I try focus them, I won't get a FocusIn event
@@ -328,7 +331,7 @@ void focus_fallback(ObFocusFallbackType type)
     */
     focus_set_client(NULL);
 
-    if (new)
+    if ((new = focus_fallback_target(type)))
         client_focus(new);
 }
 
@@ -749,7 +752,7 @@ static void to_bottom(ObClient *c, guint d)
         /* insert before first iconic window */
         for (it = focus_order[d];
              it && !((ObClient*)it->data)->iconic; it = g_list_next(it));
-        g_list_insert_before(focus_order[d], it, c);
+        focus_order[d] = g_list_insert_before(focus_order[d], it, c);
     }
 }
 
This page took 0.023742 seconds and 4 git commands to generate.