Mercurial > emacs
changeset 34911:4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
XKB versions. Call XkbFreeKeyboard with 2nd arg 0.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 28 Dec 2000 16:22:35 +0000 |
parents | fb1262412e0e |
children | fb16d295afd8 |
files | src/xfns.c |
diffstat | 1 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xfns.c Thu Dec 28 15:16:15 2000 +0000 +++ b/src/xfns.c Thu Dec 28 16:22:35 2000 +0000 @@ -11096,10 +11096,23 @@ 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 @@ backspace_keycode = i; } - XkbFreeKeyboard (kb, XkbAllComponentsMask, True); + XkbFreeKeyboard (kb, 0, True); if (delete_keycode && backspace_keycode