]> Dogcows Code - chaz/openbox/commitdiff
better code for the last commit. let transients get focus when a group member is...
authorDana Jansens <danakj@orodu.net>
Wed, 6 Jun 2007 14:34:22 +0000 (14:34 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 6 Jun 2007 14:34:22 +0000 (14:34 +0000)
openbox/client.c
openbox/client.h

index 5aa9ba74ce69edd15c943456c95a1b10c4ab4eda..5661aa1329a83b6bebdce1f1995b22eee0986b66 100644 (file)
@@ -489,7 +489,8 @@ void client_manage(Window window)
                           "desktop\n");
         }
         /* If something is focused, and it's not our relative... */
-        else if (focus_client && client_search_focus_tree_full(self) == NULL)
+        else if (focus_client && client_search_focus_tree_full(self) == NULL &&
+                 client_search_focus_group_full(self) == NULL)
         {
             /* If time stamp is old, don't steal focus */
             if (self->user_time && last_time &&
@@ -2367,19 +2368,20 @@ ObClient *client_search_focus_tree(ObClient *self)
 
 ObClient *client_search_focus_tree_full(ObClient *self)
 {
-    GSList *it;
-    ObClient *c;
-
-    if (self->transient_for && self->transient_for != OB_TRAN_GROUP) {
-        if ((c = client_search_focus_tree_full(self->transient_for)))
-            return c;
-    }
+    if (self->transient_for) {
+        if (self->transient_for != OB_TRAN_GROUP) {
+            return client_search_focus_tree_full(self->transient_for);
+        } else {
+            GSList *it;
         
-    for (it = self->group->members; it; it = g_slist_next(it)) {
-        if (it->data != self) {
-            c = it->data;
-            if (client_focused(c)) return c;
-            if ((c = client_search_focus_tree(it->data))) return c;
+            for (it = self->group->members; it; it = g_slist_next(it)) {
+                if (it->data != self) {
+                    ObClient *c = it->data;
+
+                    if (client_focused(c)) return c;
+                    if ((c = client_search_focus_tree(it->data))) return c;
+                }
+            }
         }
     }
 
@@ -2390,6 +2392,18 @@ ObClient *client_search_focus_tree_full(ObClient *self)
     return client_search_focus_tree(self);
 }
 
+ObClient *client_search_focus_group_full(ObClient *self)
+{
+    GSList *it;
+
+    for (it = self->group->members; it; it = g_slist_next(it)) {
+        ObClient *c = it->data;
+
+        if (client_focused(c)) return c;
+        if ((c = client_search_focus_tree(it->data))) return c;
+    }
+}
+
 gboolean client_has_parent(ObClient *self)
 {
     if (self->transient_for) {
index 03a1a9b7f2d6423998b087311724a1b7949b8481..f5b47ca4ef1afd1f7833eee9d28e9f8eaafbe74e 100644 (file)
@@ -635,6 +635,11 @@ ObClient *client_search_focus_tree(ObClient *self);
 */
 ObClient *client_search_focus_tree_full(ObClient *self);
 
+/*! Searches a client's group and each member's transients for a focused
+  window.  This doesn't go up the window's transient tree at all. If no
+  focused client is found, NULL is returned. */
+ObClient *client_search_focus_group_full(ObClient *self);
+
 /*! Return a modal child of the client window that can be focused.
     @return A modal child of the client window that can be focused, or 0 if
             none was found.
This page took 0.03618 seconds and 4 git commands to generate.