diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-24 13:46:40 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-26 12:53:05 +0930 |
commit | 15e4b6c57484b6afb790c7dc1db9f529ba2219cf (patch) | |
tree | 44cc68338159c55bd175688d975a13d8519ee725 /dix/devices.c | |
parent | f0c56ffd980db19bea271aeebf118bd931f6f40d (diff) |
input: for non-device events (e.g. DevicePresence) use MAX_DEVICES as id.
Using id = 0 only worked pre-MPX since XInput didn't allow XOpenDevice for the
core devices (0 and 1). Now we can now legally register for events so we may
overwrite our device-independent classes with the ones selected for the VCP.
So, increase the EMASKSIZE to MAX_DEVICES + 1 and use MAX_DEVICES as the ID
when we don't have a device.
Diffstat (limited to 'dix/devices.c')
-rw-r--r-- | dix/devices.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dix/devices.c b/dix/devices.c index 91a43f342..0a68c0e61 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -275,7 +275,7 @@ EnableDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceEnabled; ev.deviceid = dev->id; - dummyDev.id = 0; + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -339,7 +339,7 @@ DisableDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceDisabled; ev.deviceid = dev->id; - dummyDev.id = 0; + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -379,6 +379,7 @@ ActivateDevice(DeviceIntPtr dev) ev.deviceid = dev->id; memset(&dummyDev, 0, sizeof(DeviceIntRec)); + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -937,7 +938,7 @@ RemoveDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceRemoved; ev.deviceid = deviceid; - dummyDev.id = 0; + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); } |