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.
This commit is contained in:
Peter Hutterer 2007-11-14 14:27:52 +10:30
parent b44c1118f3
commit cc4586df60

View File

@ -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;