struct frame *f = decode_window_system_frame (frame);
Display *dpy = FRAME_X_DISPLAY (f);
Lisp_Object have_keys;
- int major, minor, op, event, error_code;
block_input ();
- /* Check library version in case we're dynamically linked. */
- major = XkbMajorVersion;
- minor = XkbMinorVersion;
- if (!XkbLibraryVersion (&major, &minor))
- {
- unblock_input ();
- return Qlambda;
- }
-
- /* Check that the server supports XKB. */
- major = XkbMajorVersion;
- minor = XkbMinorVersion;
- if (!XkbQueryExtension (dpy, &op, &event, &error_code, &major, &minor))
- {
- unblock_input ();
- return Qlambda;
- }
+ if (!FRAME_DISPLAY_INFO (f)->supports_xkb)
+ return Qlambda;
/* In this code we check that the keyboard has physical keys with names
that start with BKSP (Backspace) and DELE (Delete), and that they
#endif
#ifdef HAVE_XKB
- dpyinfo->xkb_desc = XkbGetMap (dpyinfo->display,
- XkbAllComponentsMask,
- XkbUseCoreKbd);
+ int xkb_major, xkb_minor, xkb_op, xkb_event, xkb_error_code;
+ xkb_major = XkbMajorVersion;
+ xkb_minor = XkbMinorVersion;
+
+ if (XkbLibraryVersion (&xkb_major, &xkb_minor)
+ && XkbQueryExtension (dpyinfo->display, &xkb_op, &xkb_event,
+ &xkb_error_code, &xkb_major, &xkb_minor))
+ {
+ dpyinfo->supports_xkb = true;
+ dpyinfo->xkb_desc = XkbGetMap (dpyinfo->display,
+ XkbAllComponentsMask,
+ XkbUseCoreKbd);
+ }
#endif
#if defined USE_CAIRO || defined HAVE_XFT