From: Po Lu Date: Fri, 15 Apr 2022 00:55:22 +0000 (+0800) Subject: Fix calls to XKB functions without testing for server support X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~2370^2~565 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=804d919ac5ca228164bf3a74b3911fa2f946fc7a;p=emacs.git Fix calls to XKB functions without testing for server support * 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. --- diff --git a/src/xterm.c b/src/xterm.c index da4af8bff75..289ea06d929 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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 ();