From: David Edmondson Date: Wed, 23 Jan 2013 16:21:07 +0000 (+0000) Subject: Allow servers which do not support the XKB extension. X-Git-Tag: 4.5~52 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3365b523843f00ff7bd3c3fddebba9972a6cdaba;p=i3%2Fi3 Allow servers which do not support the XKB extension. If we can open the X display but the XKB extension is not available, continue without it. --- diff --git a/src/main.c b/src/main.c index 7f576d43..a49241dd 100644 --- a/src/main.c +++ b/src/main.c @@ -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; }