]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
some focus changes...
[chaz/openbox] / openbox / client.c
index c8f26dcc5ba28748f4d252b1d6a4ec1a3ba871c5..3ba8ba3ba7587d42b060ca588e6a31cb856b3f3c 100644 (file)
@@ -397,6 +397,9 @@ void client_manage(Window window)
             self->area.width = MIN(self->area.width, a.width);
             self->area.height = MIN(self->area.height, a.height);
 
+            ob_debug("setting window size to %dx%d\n",
+                     self->area.width, self->area.height);
+
             /* adjust the frame to the client's new size */
             frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
             frame_adjust_client_area(self->frame);
@@ -483,10 +486,24 @@ void client_manage(Window window)
                               "Not focusing the window because the time is "
                               "too old\n");
             }
+            /* If its a transient (and parents aren't focused) and the time
+               is ambiguous (either the current focus target doesn't have
+               a timestamp, or they are the same (we probably inherited it
+               from them) */
+            else if (self->transient_for != NULL &&
+                     (!last_time || self->user_time == last_time))
+            {
+                activate = FALSE;
+                ob_debug_type(OB_DEBUG_FOCUS,
+                              "Not focusing the window because it is a "
+                              "transient, and the time is very ambiguous\n");
+            }
             /* Don't steal focus from globally active clients.
                I stole this idea from KWin. It seems nice.
              */
-            if (!(focus_client->can_focus || focus_client->focus_notify)) {
+            else if (!(focus_client->can_focus ||
+                       focus_client->focus_notify))
+            {
                 activate = FALSE;
                 ob_debug_type(OB_DEBUG_FOCUS,
                               "Not focusing the window because a globally "
This page took 0.021028 seconds and 4 git commands to generate.