]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix calls to XKB functions without testing for server support
authorPo Lu <luangruo@yahoo.com>
Fri, 15 Apr 2022 00:55:22 +0000 (08:55 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 15 Apr 2022 00:55:25 +0000 (08:55 +0800)
* src/xterm.c (x_dnd_cleanup_drag_and_drop):
(x_dnd_begin_drag_and_drop): Never call XkbSelectEvents if the
X server doesn't have XKB.

src/xterm.c

index da4af8bff75c4bc8312e9a28f751ea91da189686..289ea06d9291ba9a480130ee69f3f9499bfd3f35 100644 (file)
@@ -3615,8 +3615,9 @@ x_dnd_cleanup_drag_and_drop (void *frame)
                x_dnd_old_window_attrs.your_event_mask);
 
 #ifdef HAVE_XKB
-  XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
-                  XkbStateNotifyMask, 0);
+  if (FRAME_DISPLAY_INFO (f)->supports_xkb)
+    XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
+                    XkbStateNotifyMask, 0);
 #endif
   unblock_input ();
 
@@ -9760,8 +9761,9 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
                        FRAME_DISPLAY_INFO (f)->root_window,
                        root_window_attrs.your_event_mask);
 #ifdef HAVE_XKB
-         XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
-                          XkbStateNotifyMask, 0);
+         if (FRAME_DISPLAY_INFO (f)->supports_xkb)
+           XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
+                            XkbStateNotifyMask, 0);
 #endif
          quit ();
        }
@@ -9781,8 +9783,9 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
                FRAME_DISPLAY_INFO (f)->root_window,
                root_window_attrs.your_event_mask);
 #ifdef HAVE_XKB
-  XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
-                  XkbStateNotifyMask, 0);
+  if (FRAME_DISPLAY_INFO (f)->supports_xkb)
+    XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
+                    XkbStateNotifyMask, 0);
 #endif
   unblock_input ();