From: Dana Jansens Date: Thu, 11 Feb 2010 15:58:16 +0000 (-0500) Subject: check the xkb version before using it X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=8add92416dc9e43f689db64161cfc55fa1a73f10;p=chaz%2Fopenbox check the xkb version before using it --- diff --git a/obt/display.c b/obt/display.c index f34fc574..37b12157 100644 --- a/obt/display.c +++ b/obt/display.c @@ -58,8 +58,8 @@ gboolean obt_display_open(const char *display_name) n = display_name ? g_strdup(display_name) : NULL; obt_display = d = XOpenDisplay(n); if (d) { - gint junk; - (void)junk; + gint junk, major, minor; + (void)junk, (void)major, (void)minor; if (fcntl(ConnectionNumber(d), F_SETFD, 1) == -1) g_message("Failed to set display as close-on-exec"); @@ -67,12 +67,14 @@ gboolean obt_display_open(const char *display_name) /* read what extensions are present */ #ifdef XKB + major = XkbMajorVersion; + minor = XkbMinorVersion; obt_display_extension_xkb = XkbQueryExtension(d, &junk, &obt_display_extension_xkb_basep, &junk, - NULL, NULL); + &major, &minor); if (!obt_display_extension_xkb) - g_message("XKB extension is not present on the server"); + g_message("XKB extension is not present on the server or too old"); #endif #ifdef SHAPE