From cc4586df600af571815d5cdda2028c0d074c8469 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 14 Nov 2007 14:27:52 +1030 Subject: [PATCH] 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. --- Xi/exevents.c | 1 + 1 file changed, 1 insertion(+) 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;