/*! The source time that started the current X event (user-provided, so not
to be trusted) */
static Time event_sourcetime = CurrentTime;
+/*! Last time the cursor moved out of the focused window */
+static Time client_left_focused = CurrentTime;
/*! The serial of the current X event */
static gulong event_curserial;
return;
}
- if (client_enter_focusable(client) && client_can_focus(client)) {
+ if (client_enter_focusable(client) && client_can_focus(client) && (!config_focus_delay || event_time_after(client_left_focused, event_curtime - config_focus_delay /*milliseconds here, so not *1000 */))) {
if (config_focus_delay) {
ObFocusDelayData *data;
g_source_remove(focus_delay_timeout_id);
if (config_unfocus_leave)
event_leave_client(client);
+ else if (client == focus_client)
+ client_left_focused = e->xcrossing.time;
}
break;
default: