diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-03-27 20:17:18 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-03-27 20:17:18 +0000 |
commit | d18ff263177ea8156866b25c46bcad7324e42d76 (patch) | |
tree | 543b04f0ee926650b739f1fa039a302563bd29aa /lib | |
parent | 861758e8e109db45d391dee8a404755d406012d2 (diff) |
Ugly fix for libXi on sparc64.
May change if upstreams fix it differently.
Still broken on cross-endian remote connections though.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libXi/src/XISelEv.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libXi/src/XISelEv.c b/lib/libXi/src/XISelEv.c index f1f3fa425..e10b02dfc 100644 --- a/lib/libXi/src/XISelEv.c +++ b/lib/libXi/src/XISelEv.c @@ -32,6 +32,7 @@ in this Software without prior written authorization from the author. #include <stdint.h> +#include <X11/Xarch.h> #include <X11/Xlibint.h> #include <X11/extensions/XI2proto.h> #include <X11/extensions/XInput2.h> @@ -46,6 +47,7 @@ XISelectEvents(Display* dpy, Window win, XIEventMask* masks, int num_masks) XIEventMask *current; xXISelectEventsReq *req; xXIEventMask mask; + unsigned long long_mask; int i; int len = 0; int r = Success; @@ -83,7 +85,12 @@ XISelectEvents(Display* dpy, Window win, XIEventMask* masks, int num_masks) * and they need to be padded with 0 */ buff = calloc(1, mask.mask_len * 4); memcpy(buff, current->mask, current->mask_len); - Data32(dpy, &mask, sizeof(xXIEventMask)); +#if X_BYTE_ORDER == X_BIG_ENDIAN + long_mask = mask.deviceid << 16 | mask.mask_len; +#else + long_mask = mask.mask_len << 16 | mask.deviceid; +#endif + Data32(dpy, &long_mask, sizeof(xXIEventMask)); Data(dpy, buff, mask.mask_len * 4); free(buff); } |