Improve XI focus handling for entry and exit events

* src/xterm.c (handle_one_xevent): Skip useless
x_detect_focus_change calls in more cases.
This commit is contained in:
Po Lu 2022-08-06 10:59:15 +08:00
parent 3fee3f59f2
commit a97e9d80db

View file

@ -12521,7 +12521,6 @@ xi_handle_focus_change (struct x_display_info *dpyinfo)
if (new != focus && new)
{
#ifdef HAVE_X_I18N
if (FRAME_XIC (new))
XSetICFocus (FRAME_XIC (new));
@ -12678,13 +12677,6 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
}
break;
#ifdef HAVE_XINPUT2
case GenericEvent:
xi_focus_handle_for_device (dpyinfo, frame,
event->xcookie.data);
break;
#endif
case FocusIn:
case FocusOut:
/* Ignore transient focus events from hotkeys, window manager
@ -20110,7 +20102,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
are an inferiors of the frame's top window, which will
get virtual events. */
if (any)
x_detect_focus_change (dpyinfo, any, event, &inev.ie);
xi_focus_handle_for_device (dpyinfo, any, xi_event);
if (!any)
any = x_any_window_to_frame (dpyinfo, enter->event);
@ -20250,7 +20242,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#endif
if (any)
x_detect_focus_change (dpyinfo, any, event, &inev.ie);
xi_focus_handle_for_device (dpyinfo, any, xi_event);
#ifndef USE_X_TOOLKIT
f = x_top_window_to_frame (dpyinfo, leave->event);