diff --git a/src/ChangeLog b/src/ChangeLog index f45bd817935..64d2bbf7d9f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2000-12-28 Gerd Moellmann + * 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. diff --git a/src/xfns.c b/src/xfns.c index 6e8931b42d7..b52f7fef7c0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -11096,10 +11096,23 @@ usual X keysyms.") 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) { @@ -11118,7 +11131,7 @@ usual X keysyms.") backspace_keycode = i; } - XkbFreeKeyboard (kb, XkbAllComponentsMask, True); + XkbFreeKeyboard (kb, 0, True); if (delete_keycode && backspace_keycode