Mercurial > emacs
comparison src/xfns.c @ 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 | 53e52b3525bf |
children | 05c36b1fa618 |
comparison
equal
deleted
inserted
replaced
34910:fb1262412e0e | 34911:4cdfcac861d7 |
---|---|
11094 #ifdef HAVE_XKBGETKEYBOARD | 11094 #ifdef HAVE_XKBGETKEYBOARD |
11095 XkbDescPtr kb; | 11095 XkbDescPtr kb; |
11096 struct frame *f = check_x_frame (frame); | 11096 struct frame *f = check_x_frame (frame); |
11097 Display *dpy = FRAME_X_DISPLAY (f); | 11097 Display *dpy = FRAME_X_DISPLAY (f); |
11098 Lisp_Object have_keys; | 11098 Lisp_Object have_keys; |
11099 | 11099 int major, minor, op, event, error; |
11100 | |
11101 BLOCK_INPUT; | |
11102 | |
11103 /* Check library version in case we're dynamically linked. */ | |
11104 major = XkbMajorVersion; | |
11105 minor = XkbMinorVersion; | |
11106 if (!XkbLibraryVersion (&major, &minor)) | |
11107 return Qnil; | |
11108 | |
11109 /* Check that the server supports XKB. */ | |
11110 major = XkbMajorVersion; | |
11111 minor = XkbMinorVersion; | |
11112 if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor)) | |
11113 return Qnil; | |
11114 | |
11100 have_keys = Qnil; | 11115 have_keys = Qnil; |
11101 | |
11102 BLOCK_INPUT; | |
11103 kb = XkbGetKeyboard (dpy, XkbAllComponentsMask, XkbUseCoreKbd); | 11116 kb = XkbGetKeyboard (dpy, XkbAllComponentsMask, XkbUseCoreKbd); |
11104 if (kb) | 11117 if (kb) |
11105 { | 11118 { |
11106 int delete_keycode = 0, backspace_keycode = 0, i; | 11119 int delete_keycode = 0, backspace_keycode = 0, i; |
11107 | 11120 |
11116 delete_keycode = i; | 11129 delete_keycode = i; |
11117 else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0) | 11130 else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0) |
11118 backspace_keycode = i; | 11131 backspace_keycode = i; |
11119 } | 11132 } |
11120 | 11133 |
11121 XkbFreeKeyboard (kb, XkbAllComponentsMask, True); | 11134 XkbFreeKeyboard (kb, 0, True); |
11122 | 11135 |
11123 if (delete_keycode | 11136 if (delete_keycode |
11124 && backspace_keycode | 11137 && backspace_keycode |
11125 && XKeysymToKeycode (dpy, XK_Delete) == delete_keycode | 11138 && XKeysymToKeycode (dpy, XK_Delete) == delete_keycode |
11126 && XKeysymToKeycode (dpy, XK_BackSpace) == backspace_keycode) | 11139 && XKeysymToKeycode (dpy, XK_BackSpace) == backspace_keycode) |