]> Dogcows Code - chaz/openbox/commitdiff
some smarter rules for focusing new window when focus_new is not set
authorDana Jansens <danakj@orodu.net>
Thu, 10 Apr 2003 06:29:43 +0000 (06:29 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Apr 2003 06:29:43 +0000 (06:29 +0000)
openbox/client.c

index af24d921dad7b9dcb01e4e8e6f262f41f992e5c4..787f84c234fab21a095a3f111e20f8380ae4af5f 100644 (file)
@@ -238,8 +238,25 @@ void client_manage(Window window)
 
     dispatch_client(Event_Client_Mapped, self, 0, 0);
 
-    if (ob_state != State_Starting && config_focus_new)
-        client_focus(self);
+    /* focus the new window? */
+    if (ob_state != State_Starting) {
+        if (config_focus_new)
+            client_focus(self);
+        else if (self->transient_for) {
+            if (self->transient_for != TRAN_GROUP) {/* transient of a window */
+                if (focus_client == self->transient_for)
+                    client_focus(self);
+            } else { /* transient of a group */
+                GSList *it;
+
+                for (it = self->group->members; it; it = it->next)
+                    if (focus_client == it->data) {
+                        client_focus(self);
+                        break;
+                    }
+            }
+        }
+    }
 
     /* update the list hints */
     client_set_list();
This page took 0.024516 seconds and 4 git commands to generate.