From: Po Lu Date: Sat, 6 Aug 2022 02:59:15 +0000 (+0800) Subject: Improve XI focus handling for entry and exit events X-Git-Tag: emacs-29.0.90~1447^2~394 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a97e9d80db1c99e03566b36983037ef5f792207a;p=emacs.git 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. --- diff --git a/src/xterm.c b/src/xterm.c index bb06ee1535c..b1e564a9232 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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);