emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master eff1bb7: Fix frame focus on X Toolkit builds with XInput 2


From: Po Lu
Subject: master eff1bb7: Fix frame focus on X Toolkit builds with XInput 2
Date: Sun, 12 Dec 2021 01:01:56 -0500 (EST)

branch: master
commit eff1bb78bd3bfa60cbf4982e90217d00887ea0c8
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix frame focus on X Toolkit builds with XInput 2
    
    * src/xterm.c (x_detect_focus_change): Allow focus_state to not
    be FOCUS_EXPLICIT when handling FocusIn and FocusOut events.
---
 src/xterm.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index f212945..676de57 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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),



reply via email to

[Prev in Thread] Current Thread [Next in Thread]