2000-12-28 Gerd Moellmann <gerd@gnu.org>
+ * xfns.c (Fx_backspace_delete_keys_p): Check library and server
+ XKB versions. Call XkbFreeKeyboard with 2nd arg 0.
+
* keyboard.c (echo_char): If C is an integer, always call
push_key_description. Former code could signal an invalid
character error.
struct frame *f = check_x_frame (frame);
Display *dpy = FRAME_X_DISPLAY (f);
Lisp_Object have_keys;
-
- have_keys = Qnil;
+ int major, minor, op, event, error;
BLOCK_INPUT;
+
+ /* Check library version in case we're dynamically linked. */
+ major = XkbMajorVersion;
+ minor = XkbMinorVersion;
+ if (!XkbLibraryVersion (&major, &minor))
+ return Qnil;
+
+ /* Check that the server supports XKB. */
+ major = XkbMajorVersion;
+ minor = XkbMinorVersion;
+ if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor))
+ return Qnil;
+
+ have_keys = Qnil;
kb = XkbGetKeyboard (dpy, XkbAllComponentsMask, XkbUseCoreKbd);
if (kb)
{
backspace_keycode = i;
}
- XkbFreeKeyboard (kb, XkbAllComponentsMask, True);
+ XkbFreeKeyboard (kb, 0, True);
if (delete_keycode
&& backspace_keycode