let you nextwindow to helper windows if they ar the only thing on the desktop
authorDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 18:26:00 +0000 (18:26 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 18:26:00 +0000 (18:26 +0000)
openbox/client.c
openbox/client.h
openbox/focus.c

index 529049a8e20302e1c99bbb9f4d5466b31716fd65..e2b2636baa52101935b2ec8a105df60322f8169b 100644 (file)
@@ -3888,17 +3888,3 @@ gboolean client_has_group_siblings(ObClient *self)
 {
     return self->group && self->group->members->next;
 }
-
-gboolean client_has_non_helper_group_siblings(ObClient *self)
-{
-    GSList *it;
-
-    if (!self->group) return FALSE;
-
-    for (it = self->group->members; it; it = g_slist_next(it)) {
-        ObClient *c = it->data;
-        if (c != self && client_normal(c) && !client_helper(c))
-            return TRUE;
-    }
-    return FALSE;
-}
index ede581a738759e2f1c56e703a9646b308d8ed548..5fb26262a9f2b8e29b5b17ada0b4f21c22acfbc1 100644 (file)
@@ -661,8 +661,4 @@ ObClient* client_under_pointer();
 
 gboolean client_has_group_siblings(ObClient *self);
 
-/*! Returns if a client has an group siblings which are main application
-  windows (not helper or non-normal windows) */
-gboolean client_has_non_helper_group_siblings(ObClient *self);
-
 #endif
index b473686aea5a49b970e76dc303436c0502a41cd5..71d220264f64696733d4149d9501ab65d6eb30c1 100644 (file)
@@ -528,6 +528,25 @@ void focus_cycle_draw_indicator()
     }
 }
 
+static gboolean has_non_helper_group_siblings_on_desktop(ObClient *ft,
+                                                         gboolean all_desktops)
+{
+    GSList *it;
+
+    if (!ft->group) return FALSE;
+
+    for (it = ft->group->members; it; it = g_slist_next(it)) {
+        ObClient *c = it->data;
+        if (c != ft && client_normal(c) && !client_helper(c) &&
+            (c->desktop == ft->desktop || c->desktop == DESKTOP_ALL ||
+             all_desktops))
+        {
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
 static gboolean valid_focus_target(ObClient *ft,
                                    gboolean all_desktops,
                                    gboolean dock_windows)
@@ -557,7 +576,9 @@ static gboolean valid_focus_target(ObClient *ft,
                         group already has focus ... */
                      ((focus_client && ft->group == focus_client->group) ||
                       /* ... or if there are no main windows in its group */
-                      !client_has_non_helper_group_siblings(ft))));
+                      !has_non_helper_group_siblings_on_desktop(ft,
+                                                                all_desktops))
+                        ));
 
     /* it's not set to skip the taskbar (unless it is a type that would be
        expected to set this hint */