]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve XI focus handling for entry and exit events
authorPo Lu <luangruo@yahoo.com>
Sat, 6 Aug 2022 02:59:15 +0000 (10:59 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 6 Aug 2022 02:59:15 +0000 (10:59 +0800)
* src/xterm.c (handle_one_xevent): Skip useless
x_detect_focus_change calls in more cases.

src/xterm.c

index bb06ee1535ca777130f682b4f1312bdf5d5067cf..b1e564a92328c6db8eb4c356a13be04cceecc1d9 100644 (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);