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.
This commit is contained in:
David Edmondson 2013-01-23 16:21:07 +00:00 committed by Michael Stapelberg
parent 2478d0a2e0
commit 3365b52384
1 changed files with 4 additions and 4 deletions

View 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;
}