diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-23 09:13:41 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-23 17:39:07 +1030 |
commit | 98f01c2abe4771d76febf8fe70111b2bddfab776 (patch) | |
tree | fce2b3eafb1914a29d8b4bc4304de9eacbc1103b /dix | |
parent | f6cbe0326c57e3c9897f17baef78199b06537c44 (diff) |
dix: fix endianess issue in AddInputDevice. #18111
dev->enabled is a Bool. Bool is two bytes.
BOOL on the other hand is a protocol type and always 1 byte. So copy the value
into the one-byte type before passing it into XIChangeDeviceProperty.
Found by Michel Dänzer.
X.Org Bug 18111 <http://bugs.freedesktop.org/show_bug.cgi?id=18111>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/devices.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dix/devices.c b/dix/devices.c index d386f4113..972edcb38 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -139,6 +139,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) DeviceIntPtr devtmp; int devid; char devind[MAX_DEVICES]; + BOOL enabled; /* Find next available id */ memset(devind, 0, sizeof(char)*MAX_DEVICES); @@ -183,8 +184,9 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) *prev = dev; dev->next = NULL; + enabled = TRUE; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), - XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, + XA_INTEGER, 8, PropModeReplace, 1, &enabled, FALSE); XISetDevicePropertyDeletable(dev, XIGetKnownProperty(XI_PROP_ENABLED), FALSE); XIRegisterPropertyHandler(dev, DeviceSetProperty, NULL, NULL); |