From 389190ba410b5ac19661beeb696994b5197e7898 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 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index e000f29..8fac981 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; -- 1.6.3.rc1.2.g0164.dirty