Allow servers which do not support the XKB extension.
Patch status: merged
Patch by David Edmondson
Long description:
If we can open the X display but the XKB extension is not available, continue without it.
To apply this patch, use:
curl http://cr.i3wm.org/patch/2/raw.patch | git am
b/src/main.c
| 15 |
@@ -593,13 +593,13 @@ int main(int argc, char *argv[]) {
|
| 16 |
int i1; |
| 17 |
if (!XkbQueryExtension(xkbdpy,&i1,&xkb_event_base,&errBase,&major,&minor)) {
|
| 18 |
fprintf(stderr, "XKB not supported by X-server\n"); |
| 19 |
- return 1; |
| 20 |
- } |
| 21 |
+ xkb_supported = false; |
| 22 |
+ } |
| 23 |
/* end of ugliness */ |
| 24 |
|
| 25 |
- if (!XkbSelectEvents(xkbdpy, XkbUseCoreKbd, |
| 26 |
- XkbMapNotifyMask | XkbStateNotifyMask, |
| 27 |
- XkbMapNotifyMask | XkbStateNotifyMask)) {
|
| 28 |
+ if (xkb_supported && !XkbSelectEvents(xkbdpy, XkbUseCoreKbd, |
| 29 |
+ XkbMapNotifyMask | XkbStateNotifyMask, |
| 30 |
+ XkbMapNotifyMask | XkbStateNotifyMask)) {
|
| 31 |
fprintf(stderr, "Could not set XKB event mask\n"); |
| 32 |
return 1; |
| 33 |
} |