]> Dogcows Code - chaz/openbox/commitdiff
check the xkb version before using it
authorDana Jansens <danakj@orodu.net>
Thu, 11 Feb 2010 15:58:16 +0000 (10:58 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 11 Feb 2010 16:01:18 +0000 (11:01 -0500)
obt/display.c

index f34fc574056915dc5151d4ea538ac12b7d4ddf48..37b1215737bf1117e3dc95dcd7839a65d76bcb01 100644 (file)
@@ -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
This page took 0.028094 seconds and 4 git commands to generate.