emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 91ba20fff1: Work around potential X server bug


From: Po Lu
Subject: master 91ba20fff1: Work around potential X server bug
Date: Sat, 3 Sep 2022 07:57:22 -0400 (EDT)

branch: master
commit 91ba20fff159cc88c87e09f5a8256d6412c98990
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Work around potential X server bug
    
    * src/xterm.c (handle_one_xevent): Ignore core crossing events
    on input extension builds.  The X server is not actually
    supposed to deliver them to us, and it messes up MPX focus
    tracking.  (bug#57468)
---
 src/xterm.c | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 138fa7ea6c..19d2198cdf 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -19276,6 +19276,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       x_display_set_last_user_time (dpyinfo, event->xcrossing.time,
                                    event->xcrossing.send_event);
 
+#ifdef HAVE_XINPUT2
+      /* For whatever reason, the X server continues to deliver
+        EnterNotify and LeaveNotify events despite us selecting for
+        related XI_Enter and XI_Leave events.  It's not just our
+        problem, since windows created by "xinput test-xi2" suffer
+        from the same defect.  Simply ignore all such events while
+        the input extension is enabled.  (bug#57468) */
+
+      if (dpyinfo->supports_xi2)
+       goto OTHER;
+#endif
+
       if (x_top_window_to_frame (dpyinfo, event->xcrossing.window))
        x_detect_focus_change (dpyinfo, any, event, &inev.ie);
 
@@ -19377,6 +19389,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       x_display_set_last_user_time (dpyinfo, event->xcrossing.time,
                                    event->xcrossing.send_event);
 
+#ifdef HAVE_XINPUT2
+      /* For whatever reason, the X server continues to deliver
+        EnterNotify and LeaveNotify events despite us selecting for
+        related XI_Enter and XI_Leave events.  It's not just our
+        problem, since windows created by "xinput test-xi2" suffer
+        from the same defect.  Simply ignore all such events while
+        the input extension is enabled.  (bug#57468) */
+
+      if (dpyinfo->supports_xi2)
+       goto OTHER;
+#endif
+
 #ifdef HAVE_XWIDGETS
       {
        struct xwidget_view *xvw = xwidget_view_from_window 
(event->xcrossing.window);
@@ -19402,14 +19426,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #else
       f = x_top_window_to_frame (dpyinfo, event->xcrossing.window);
 #endif
-#if defined USE_X_TOOLKIT && defined HAVE_XINPUT2 && !defined USE_MOTIF
-      /* The XI2 event mask is set on the frame widget, so this event
-        likely originates from the shell widget, which we aren't
-        interested in.  (But don't ignore this on Motif, since we
-        want to clear the mouse face when a popup is active.)  */
-      if (dpyinfo->supports_xi2)
-       f = NULL;
-#endif
+
       if (f)
         {
          /* Now clear dpyinfo->last_mouse_motion_frame, or



reply via email to

[Prev in Thread] Current Thread [Next in Thread]