]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus_cycle.c
make the client list menu update properly and not crash
[chaz/openbox] / openbox / focus_cycle.c
index 56a228387c2621e3cc273efcb9fd72671907d199..4c0630b30abe39fc2edf0def2e5bccb12b99d195 100644 (file)
@@ -124,7 +124,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 +140,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) */
@@ -375,8 +378,9 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
     }
     if (focus_cycle_target && dialog) {
         /* same arguments as focus_target_valid */
-        focus_cycle_popup_show(focus_cycle_target, FALSE, FALSE, dock_windows,
-                               desktop_windows);
+        focus_cycle_popup_single_show(focus_cycle_target,
+                                      FALSE, FALSE, dock_windows,
+                                      desktop_windows);
         return;
     }
 
@@ -388,7 +392,7 @@ done_cycle:
     focus_cycle_target = NULL;
 
     focus_cycle_draw_indicator(NULL);
-    focus_cycle_popup_hide();
+    focus_cycle_popup_single_hide();
 
     return;
 }
This page took 0.028869 seconds and 4 git commands to generate.