aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2021-12-12 14:00:09 +0800
committerPo Lu2021-12-12 14:01:45 +0800
commiteff1bb78bd3bfa60cbf4982e90217d00887ea0c8 (patch)
tree278bcd8c54495c919b82eb8111841e0e0d0a8b1b
parent95d7a794cc48312c41a34ef9cdc0e5c95f35d2ac (diff)
downloademacs-eff1bb78bd3bfa60cbf4982e90217d00887ea0c8.tar.gz
emacs-eff1bb78bd3bfa60cbf4982e90217d00887ea0c8.zip
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.
-rw-r--r--src/xterm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c
index f2129458e16..676de57455c 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,
5144 int focus_state 5144 int focus_state
5145 = focus_frame ? focus_frame->output_data.x->focus_state : 0; 5145 = focus_frame ? focus_frame->output_data.x->focus_state : 0;
5146 5146
5147 if (!((xi_event->evtype == XI_Enter 5147 if (!((((xi_event->evtype == XI_Enter
5148 || xi_event->evtype == XI_Leave) 5148 || xi_event->evtype == XI_Leave)
5149 && (focus_state & FOCUS_EXPLICIT))) 5149 && (((XIEnterEvent *) xi_event)->detail
5150 != XINotifyInferior)
5151 && (focus_state & FOCUS_EXPLICIT))
5152 || xi_event->evtype == XI_FocusIn
5153 || xi_event->evtype == XI_FocusOut)))
5150 x_focus_changed ((xi_event->evtype == XI_Enter 5154 x_focus_changed ((xi_event->evtype == XI_Enter
5151 || xi_event->evtype == XI_FocusIn 5155 || xi_event->evtype == XI_FocusIn
5152 ? FocusIn : FocusOut), 5156 ? FocusIn : FocusOut),