- guint32 last_time = focus_client ? focus_client->user_time : CurrentTime;
- gboolean allow = FALSE;
-
- /* if the currently focused app doesn't set a user_time, then it can't
- benefit from any focus stealing prevention.
-
- if the timestamp is missing in the request then let it go through
- even if it is source=app, because EVERY APPLICATION DOES THIS because
- GTK IS VERY BUGGY AND HARDCODES source=application... WHY!?
- */
- if (!last_time || !event_curtime)
- allow = TRUE;
- /* otherwise, if they didn't give a time stamp or if it is too old, they
- don't get focus */
- else
- allow = event_time_after(event_curtime, last_time);
-
- ob_debug_type(OB_DEBUG_FOCUS,
- "Want to activate window 0x%x with time %u (last time %u), "
- "source=%s allowing? %d\n",
- self->window, event_curtime, last_time,
- (user ? "user" : "application"), allow);
-
- if (allow)
- client_present(self, here, raise, unshade);
- else
- /* don't focus it but tell the user it wants attention */
- client_hilite(self, TRUE);