aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 9336b9420f6..9b0fe6f3f7b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -19200,6 +19200,10 @@ static void x_error_quitter (Display *, XErrorEvent *);
19200static int 19200static int
19201x_error_handler (Display *display, XErrorEvent *event) 19201x_error_handler (Display *display, XErrorEvent *event)
19202{ 19202{
19203#ifdef HAVE_XINPUT2
19204 struct x_display_info *dpyinfo;
19205#endif
19206
19203#if defined USE_GTK && defined HAVE_GTK3 19207#if defined USE_GTK && defined HAVE_GTK3
19204 if ((event->error_code == BadMatch || event->error_code == BadWindow) 19208 if ((event->error_code == BadMatch || event->error_code == BadWindow)
19205 && event->request_code == X_SetInputFocus) 19209 && event->request_code == X_SetInputFocus)
@@ -19208,6 +19212,20 @@ x_error_handler (Display *display, XErrorEvent *event)
19208 } 19212 }
19209#endif 19213#endif
19210 19214
19215 /* If we try to ungrab or grab a device that doesn't exist anymore
19216 (that happens a lot in xmenu.c), just ignore the error. */
19217
19218#ifdef HAVE_XINPUT2
19219 dpyinfo = x_display_info_for_display (display);
19220
19221 /* 51 is X_XIGrabDevice and 52 is X_XIUngrabDevice. */
19222 if (dpyinfo && dpyinfo->supports_xi2
19223 && event->request_code == dpyinfo->xi2_opcode
19224 && (event->minor_code == 51
19225 || event->minor_code == 52))
19226 return 0;
19227#endif
19228
19211 if (x_error_message) 19229 if (x_error_message)
19212 x_error_catcher (display, event); 19230 x_error_catcher (display, event);
19213 else 19231 else