diff --git a/src/xterm.c b/src/xterm.c index 12c14e5e4f1..00cb04f005d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5246,6 +5246,7 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame, || xi_event->evtype == XI_Leave) && (((XIEnterEvent *) xi_event)->detail != XINotifyInferior) + && ((XIEnterEvent *) xi_event)->focus && !(focus_state & FOCUS_EXPLICIT)) x_focus_changed ((xi_event->evtype == XI_Enter ? FocusIn : FocusOut),