+ if (activate) {
+ /* This is focus stealing prevention, if a user_time has been set */
+ ob_debug("Want to focus new window 0x%x with time %u (last time %u)\n",
+ self->window, self->user_time, client_last_user_time);
+ if (!self->user_time || self->user_time >= client_last_user_time)
+ {
+ /* since focus can change the stacking orders, if we focus the
+ window then the standard raise it gets is not enough, we need
+ to queue one for after the focus change takes place */
+ client_raise(self);
+ } else {
+ ob_debug("Focus stealing prevention activated for %s with time %u "
+ "(last time %u)\n",
+ self->title, self->user_time, client_last_user_time);
+ /* if the client isn't focused, then hilite it so the user
+ knows it is there */
+ client_hilite(self, TRUE);
+
+ /* don't focus it ! (focus stealing prevention) */
+ activate = FALSE;
+ }
+ }
+ else {
+ /* This may look rather odd. Well it's because new windows are added
+ to the stacking order non-intrusively. If we're not going to focus
+ the new window or hilite it, then we raise it to the top. This will
+ take affect for things that don't get focused like splash screens.
+ Also if you don't have focus_new enabled, then it's going to get
+ raised to the top. Legacy begets legacy I guess?
+ */
+ client_raise(self);
+ }
+
+ /* this has to happen before we try focus the window, but we want it to
+ happen after the client's stacking has been determined or it looks bad
+ */