]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus_cycle.c
when canceling focus cycling, cancel both normal and directional
[chaz/openbox] / openbox / focus_cycle.c
index 9c64cdb99f3d22760f1fb9305c58ff9c2b5dd592..cb6678d27002128ab5afe407273e77e40b0b6937 100644 (file)
@@ -62,8 +62,10 @@ void focus_cycle_shutdown(gboolean reconfig)
 
 void focus_cycle_stop()
 {
-    if (focus_cycle_target)
+    if (focus_cycle_target) {
         focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
+        focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
+    }
 }
 
 static void focus_cycle_destroy_notify(ObClient *client, gpointer data)
@@ -124,7 +126,9 @@ gboolean focus_cycle_target_valid(ObClient *ft,
     if (dock_windows || desktop_windows)
         ok = ok && ((dock_windows && ft->type == OB_CLIENT_TYPE_DOCK) ||
                     (desktop_windows && ft->type == OB_CLIENT_TYPE_DESKTOP));
-    else
+    /* modal windows are important and can always get focus if they are
+       visible and stuff, so don't change 'ok' based on their type */ 
+    else if (!ft->modal)
         /* normal non-helper windows are valid targets */
         ok = ok &&
             ((client_normal(ft) && !client_helper(ft))
@@ -138,12 +142,13 @@ gboolean focus_cycle_target_valid(ObClient *ft,
                !focus_target_has_siblings(ft, iconic_windows, all_desktops))));
 
     /* it's not set to skip the taskbar (unless it is a type that would be
-       expected to set this hint */
+       expected to set this hint, or modal) */
     ok = ok && ((ft->type == OB_CLIENT_TYPE_DOCK ||
                  ft->type == OB_CLIENT_TYPE_DESKTOP ||
                  ft->type == OB_CLIENT_TYPE_TOOLBAR ||
                  ft->type == OB_CLIENT_TYPE_MENU ||
                  ft->type == OB_CLIENT_TYPE_UTILITY) ||
+                ft->modal ||
                 !ft->skip_taskbar);
 
     /* it's not going to just send fous off somewhere else (modal window) */
@@ -393,19 +398,3 @@ done_cycle:
 
     return;
 }
-
-void focus_order_add_new(ObClient *c)
-{
-    if (c->iconic)
-        focus_order_to_top(c);
-    else {
-        g_assert(!g_list_find(focus_order, c));
-        /* if there are any iconic windows, put this above them in the order,
-           but if there are not, then put it under the currently focused one */
-        if (focus_order && ((ObClient*)focus_order->data)->iconic)
-            focus_order = g_list_insert(focus_order, c, 0);
-        else
-            focus_order = g_list_insert(focus_order, c, 1);
-    }
-}
-
This page took 0.021104 seconds and 4 git commands to generate.