emacs-diffs
[Top][All Lists]
Advanced

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

master 9a888323c6: ; * src/xterm.c (x_error_handler): Fix magic numbers.


From: Po Lu
Subject: master 9a888323c6: ; * src/xterm.c (x_error_handler): Fix magic numbers.
Date: Wed, 13 Jul 2022 21:11:51 -0400 (EDT)

branch: master
commit 9a888323c60c60fb37f471ef03f0bcdff91cb850
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    ; * src/xterm.c (x_error_handler): Fix magic numbers.
---
 src/xterm.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 284a08769a..3dfbe111d3 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -805,6 +805,20 @@ static int current_finish;
 static struct input_event *current_hold_quit;
 #endif
 
+#ifdef HAVE_XINPUT2
+#ifndef X_XIGrabDevice
+#define X_XIGrabDevice 51
+#endif
+
+#ifndef X_XIUngrabDevice
+#define X_XIUngrabDevice 52
+#endif
+
+#ifndef X_XIAllowEvents
+#define X_XIAllowEvents 53
+#endif
+#endif
+
 /* Queue selection requests in `pending_selection_requests' if more
    than 0.  */
 static int x_use_pending_selection_requests;
@@ -23579,15 +23593,13 @@ x_error_handler (Display *display, XErrorEvent *event)
      (that happens a lot in xmenu.c), just ignore the error.  */
 
 #ifdef HAVE_XINPUT2
-  /* 51 is X_XIGrabDevice and 52 is X_XIUngrabDevice.
-
-     53 is X_XIAllowEvents.  We handle errors from that here to avoid
-     a sync in handle_one_xevent.  */
+  /* Handle errors from some specific XI2 requests here to avoid a
+     sync in handle_one_xevent.  */
   if (dpyinfo && dpyinfo->supports_xi2
       && event->request_code == dpyinfo->xi2_opcode
-      && (event->minor_code == 51
-         || event->minor_code == 52
-         || event->minor_code == 53))
+      && (event->minor_code == X_XIGrabDevice
+         || event->minor_code == X_XIUngrabDevice
+         || event->minor_code == X_XIAllowEvents))
     return 0;
 #endif
 



reply via email to

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