]> Dogcows Code - chaz/openbox/commitdiff
add the notion of "application windows" meaning normal or dialog type windows.
authorDana Jansens <danakj@orodu.net>
Thu, 3 May 2007 20:57:40 +0000 (20:57 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 3 May 2007 20:57:40 +0000 (20:57 +0000)
let you alt-tab to non-application windows when they dont have an application window in their group

openbox/client.c
openbox/client.h
openbox/focus.c

index 34ae4d868f5e770e7e58592f1ccd05cdb8967246..c7859ca67838fa87dfd5c65789d18b24783f44c3 100644 (file)
@@ -2198,6 +2198,12 @@ gboolean client_normal(ObClient *self) {
               self->type == OB_CLIENT_TYPE_SPLASH);
 }
 
+gboolean client_application(ObClient *self)
+{
+    return (self->type == OB_CLIENT_TYPE_NORMAL ||
+            self->type == OB_CLIENT_TYPE_DIALOG);
+}
+
 static void client_apply_startup_state(ObClient *self, gint x, gint y)
 {
     gboolean pos = FALSE; /* has the window's position been configured? */
@@ -3633,3 +3639,17 @@ gboolean client_has_group_siblings(ObClient *self)
 {
     return self->group && self->group->members->next;
 }
+
+gboolean client_has_application_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_application(c))
+            return TRUE;
+    }
+    return FALSE;
+}
index f75d155cb9930ae19efbf9cd4a38a1664e1fecac..1273a6871c350ca356758da056e631a8a5922f35 100644 (file)
@@ -348,6 +348,11 @@ gboolean client_should_show(ObClient *self);
   to them in a number of places regarding focus or user interaction. */
 gboolean client_normal(ObClient *self);
 
+/*! Returns if the window is one of an application's main windows (normal or
+  dialog type) rather than an accessory window (utilty, menu, etc) or a
+  non-normal window */
+gboolean client_application(ObClient *self);
+
 /* Returns if the window is focused */
 gboolean client_focused(ObClient *self);
 
@@ -661,4 +666,6 @@ ObClient* client_under_pointer();
 
 gboolean client_has_group_siblings(ObClient *self);
 
+gboolean client_has_application_group_siblings(ObClient *self);
+
 #endif
index 8fcb13f93d4bb01b0453cb199a0966d046984d42..b1e312361152c733712a9d6d6dfa816e2bb962e5 100644 (file)
@@ -475,7 +475,7 @@ static gboolean valid_focus_target(ObClient *ft, gboolean dock_windows)
     else
         ok = (ft->type == OB_CLIENT_TYPE_NORMAL ||
               ft->type == OB_CLIENT_TYPE_DIALOG ||
-              (!client_has_group_siblings(ft) &&
+              (!client_has_application_group_siblings(ft) &&
                (ft->type == OB_CLIENT_TYPE_TOOLBAR ||
                 ft->type == OB_CLIENT_TYPE_MENU ||
                 ft->type == OB_CLIENT_TYPE_UTILITY)));
This page took 0.097512 seconds and 4 git commands to generate.