If we can open the X display but the XKB extension is not available,
continue without it.
int i1;
if (!XkbQueryExtension(xkbdpy,&i1,&xkb_event_base,&errBase,&major,&minor)) {
fprintf(stderr, "XKB not supported by X-server\n");
int i1;
if (!XkbQueryExtension(xkbdpy,&i1,&xkb_event_base,&errBase,&major,&minor)) {
fprintf(stderr, "XKB not supported by X-server\n");
- 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;
}
fprintf(stderr, "Could not set XKB event mask\n");
return 1;
}