From 415c6df0da1197d487456b4c48e2e28e7ded8b8e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 13 Apr 2008 11:46:44 +0930 Subject: [PATCH] Xi: copy feedback classes first, in some cases xkb relies on kbdfeed. XkbInitIndicatorMap (in XkbInitDevice) calls XkbFindSrvLedInfo. This accesses the devices kbdfeed struct, which is all nice and dandy if it is NULL. When copying the device classes however, kbdfeed may not be NULL and thus XkbFindSrvLedInfo goes on its merry way to do whatever it does. By copying kbdfeed first, we avoid XkbFSLI to reference the "old" kbdfeed struct of the previous SD. --- Xi/exevents.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 1d4dc51bf..6fa08d133 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -416,6 +416,11 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) _X_EXPORT void DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) { + /* XkbInitDevice (->XkbInitIndicatorMap->XkbFindSrvLedInfo) relies on the + * kbdfeed to be set up properly, so let's do the feedback classes first. + */ + DeepCopyFeedbackClasses(from, to); + #define ALLOC_COPY_CLASS_IF(field, type) \ if (from->field)\ { \ @@ -528,7 +533,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) to->absolute = NULL; } - DeepCopyFeedbackClasses(from, to); } /**