]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix frame focus on X Toolkit builds with XInput 2
authorPo Lu <luangruo@yahoo.com>
Sun, 12 Dec 2021 06:00:09 +0000 (14:00 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 12 Dec 2021 06:01:45 +0000 (14:01 +0800)
* src/xterm.c (x_detect_focus_change): Allow focus_state to not
be FOCUS_EXPLICIT when handling FocusIn and FocusOut events.

src/xterm.c

index f2129458e16a5ec6f07729cd236c3942e23d81d0..676de57455c6a82987cbeef8891ea2e3bfdc5167 100644 (file)
@@ -5144,9 +5144,13 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
         int focus_state
           = focus_frame ? focus_frame->output_data.x->focus_state : 0;
 
-       if (!((xi_event->evtype == XI_Enter
-              || xi_event->evtype == XI_Leave)
-             && (focus_state & FOCUS_EXPLICIT)))
+       if (!((((xi_event->evtype == XI_Enter
+                || xi_event->evtype == XI_Leave)
+               && (((XIEnterEvent *) xi_event)->detail
+                   != XINotifyInferior)
+               && (focus_state & FOCUS_EXPLICIT))
+              || xi_event->evtype == XI_FocusIn
+              || xi_event->evtype == XI_FocusOut)))
          x_focus_changed ((xi_event->evtype == XI_Enter
                            || xi_event->evtype == XI_FocusIn
                            ? FocusIn : FocusOut),