- if (!self->user_time || self->user_time >= client_last_user_time ||
- client_search_focus_parent(self) != NULL)
+
+ /* If a nothing at all, or a parent was focused, then focus this
+ always
+ */
+ if (!focus_client || client_search_focus_parent(self) != NULL)
+ activate = TRUE;
+ else
+ {
+ /* If time stamp is old, don't steal focus */
+ if (self->user_time && self->user_time < client_last_user_time)
+ activate = FALSE;
+ /* 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)
+ activate = FALSE;
+ }
+
+ if (activate)