aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-08 21:25:37 +0800
committerPo Lu2022-03-08 21:26:37 +0800
commita7fdbed880fb92392b93c3ad53e89c0ce7ba515f (patch)
treec60e6b94597c5527fdef8a4ddb30360c81a6b393 /src
parentbbbb47704f6c7e56a96983976fbb0ab1acca652f (diff)
downloademacs-a7fdbed880fb92392b93c3ad53e89c0ce7ba515f.tar.gz
emacs-a7fdbed880fb92392b93c3ad53e89c0ce7ba515f.zip
Handle XI focus change events that specify implicit focus correctly
* src/xterm.c (x_detect_focus_change): If detail is XINotifyPointer, set focus type to implicit.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 72c7c05d893..94b8f60c716 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6480,7 +6480,8 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
6480#ifdef HAVE_XINPUT2 6480#ifdef HAVE_XINPUT2
6481 case GenericEvent: 6481 case GenericEvent:
6482 { 6482 {
6483 XIEvent *xi_event = (XIEvent *) event->xcookie.data; 6483 XIEvent *xi_event = event->xcookie.data;
6484 XIEnterEvent *enter_or_focus = event->xcookie.data;
6484 6485
6485 struct frame *focus_frame = dpyinfo->x_focus_event_frame; 6486 struct frame *focus_frame = dpyinfo->x_focus_event_frame;
6486 int focus_state 6487 int focus_state
@@ -6490,13 +6491,14 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
6490 || xi_event->evtype == XI_FocusOut) 6491 || xi_event->evtype == XI_FocusOut)
6491 x_focus_changed ((xi_event->evtype == XI_FocusIn 6492 x_focus_changed ((xi_event->evtype == XI_FocusIn
6492 ? FocusIn : FocusOut), 6493 ? FocusIn : FocusOut),
6493 FOCUS_EXPLICIT, 6494 ((enter_or_focus->detail
6494 dpyinfo, frame, bufp); 6495 == XINotifyPointer)
6496 ? FOCUS_IMPLICIT : FOCUS_EXPLICIT),
6497 dpyinfo, frame, bufp);
6495 else if ((xi_event->evtype == XI_Enter 6498 else if ((xi_event->evtype == XI_Enter
6496 || xi_event->evtype == XI_Leave) 6499 || xi_event->evtype == XI_Leave)
6497 && (((XIEnterEvent *) xi_event)->detail 6500 && (enter_or_focus->detail != XINotifyInferior)
6498 != XINotifyInferior) 6501 && enter_or_focus->focus
6499 && ((XIEnterEvent *) xi_event)->focus
6500 && !(focus_state & FOCUS_EXPLICIT)) 6502 && !(focus_state & FOCUS_EXPLICIT))
6501 x_focus_changed ((xi_event->evtype == XI_Enter 6503 x_focus_changed ((xi_event->evtype == XI_Enter
6502 ? FocusIn : FocusOut), 6504 ? FocusIn : FocusOut),