diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-14 14:27:52 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-14 14:27:52 +1030 |
commit | cc4586df600af571815d5cdda2028c0d074c8469 (patch) | |
tree | 5151b90d3afd33ca7b35424f38d82686c842df68 | |
parent | b44c1118f3bab6d5f28fa42e0c322fbaec005012 (diff) |
Xi: toggle the public.devPrivate as well when switching device classes.
The master needs to have the same devPrivate as the slave, in case a client
issues a request that goes down to the driver.
Example: if a driver wants to ring the keyboard bell, it'll pick a keyboard.
The KeyClassPtr will direct it to the matching method in the driver, but
because the MD doesn't have the devPrivate set the driver segfaults.
Even if all drivers were updated to not dereference the nullpointer, nothing
would actually ever happen.
To avoid this, we flip the master's public.devPrivate to the last SDs
devPrivate.
-rw-r--r-- | Xi/exevents.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index f60f634b7..91035c7cb 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -118,6 +118,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, dcce->deviceid = master->id; dcce->num_classes = 0; + master->public.devicePrivate = device->public.devicePrivate; master->key = device->key; master->valuator = device->valuator; master->button = device->button; |