]> git.sur5r.net Git - i3/i3/commitdiff
Allow servers which do not support the XKB extension.
authorDavid Edmondson <dme@dme.org>
Wed, 23 Jan 2013 16:21:07 +0000 (16:21 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 23 Jan 2013 19:27:27 +0000 (20:27 +0100)
If we can open the X display but the XKB extension is not available,
continue without it.

src/main.c

index 7f576d435cc7dc11a2dcfaaa108158f67edd4315..a49241dda9d4ec39737c397caeed73ac830e727b 100644 (file)
@@ -595,13 +595,13 @@ int main(int argc, char *argv[]) {
         int i1;
         if (!XkbQueryExtension(xkbdpy,&i1,&xkb_event_base,&errBase,&major,&minor)) {
             fprintf(stderr, "XKB not supported by X-server\n");
-            return 1;
+           xkb_supported = false;
         }
         /* end of ugliness */
 
-        if (!XkbSelectEvents(xkbdpy, XkbUseCoreKbd,
-                             XkbMapNotifyMask | XkbStateNotifyMask,
-                             XkbMapNotifyMask | XkbStateNotifyMask)) {
+        if (xkb_supported && !XkbSelectEvents(xkbdpy, XkbUseCoreKbd,
+                                              XkbMapNotifyMask | XkbStateNotifyMask,
+                                              XkbMapNotifyMask | XkbStateNotifyMask)) {
             fprintf(stderr, "Could not set XKB event mask\n");
             return 1;
         }