From 183c075d2f9d5f6effa1ce7ab135fb0c2e46085a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 3 Jul 2009 13:26:48 +1000 Subject: [PATCH] dix: always init the full button map to default values (#22594) Master devices must have the standard button map applied for all buttons to ensure buttons larger than 7 (the default for MDs) are mapped appropriately. We can't copy the button map from SDs to MDs since that breaks the chained button mapping. However, by ensuring all buttons (even non-existing ones) are mapped, devices that send such buttons continue to work. X.Org Bug 22594 Signed-off-by: Peter Hutterer --- dix/devices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index e000f29ce..8fac981bf 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1172,6 +1172,8 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom* labels, butc->sourceid = dev->id; for (i = 1; i <= numButtons; i++) butc->map[i] = map[i]; + for (i = numButtons + 1; i < MAP_LENGTH; i++) + butc->map[i] = i; memcpy(butc->labels, labels, numButtons * sizeof(Atom)); dev->button = butc; return TRUE;