]> Dogcows Code - chaz/openbox/commitdiff
more strict rules on what will be focused by the focusNew option in the rc3. only...
authorDana Jansens <danakj@orodu.net>
Fri, 18 Apr 2003 04:13:08 +0000 (04:13 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 18 Apr 2003 04:13:08 +0000 (04:13 +0000)
openbox/client.c

index da3a8e323713b3999bd68419f970ad4b74bdf500..dd1f96420eaa79c22b08fe34b15ffe0dd40b2a48 100644 (file)
@@ -153,6 +153,7 @@ void client_manage(Window window)
     XSetWindowAttributes attrib_set;
 /*    XWMHints *wmhint; */
     guint i;
+    gboolean f;
 
     grab_server(TRUE);
 
@@ -240,22 +241,30 @@ void client_manage(Window window)
 
     /* focus the new window? */
     if (ob_state != State_Starting && client_normal(self)) {
-        if (config_focus_new)
-            client_focus(self);
-        else if (self->transient_for) {
+        f = FALSE;
+
+        if (self->transient_for) {
             if (self->transient_for != TRAN_GROUP) {/* transient of a window */
-                if (focus_client == self->transient_for)
+                if (focus_client == self->transient_for) {
                     client_focus(self);
+                    f = TRUE;
+                }
             } else { /* transient of a group */
                 GSList *it;
 
                 for (it = self->group->members; it; it = it->next)
                     if (focus_client == it->data) {
                         client_focus(self);
+                        f = TRUE;
                         break;
                     }
             }
         }
+        /* note the check against Type_Normal, not client_normal(self), which
+           would also include dialog types. in this case we want more strict
+           rules for focus */
+        if (!f && config_focus_new && self->type == Type_Normal)
+            client_focus(self);
     }
 
     /* update the list hints */
This page took 0.0262 seconds and 4 git commands to generate.