From 6240c226ef429ade3926be0a65341117de2b24e5 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Thu, 9 Feb 2012 11:07:39 -0800 Subject: Check for appropriate number of properties when setting buttons Commit 7e92aca6 changed the length of the Wacom Button Actions property to be dynamically calculated, but did not take this into account for the property setter (preventing xsetwacom from updating them). This patch replaces the constant length with an identical calculation to ensure we check for the proper size. Signed-off-by: Jason Gerecke Reviewed-by: Peter Hutterer --- src/wcmXCommand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c index d0963f1..0fd5664 100644 --- a/src/wcmXCommand.c +++ b/src/wcmXCommand.c @@ -849,7 +849,8 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, #endif } else if (property == prop_btnactions) { - if (prop->size != WCM_MAX_BUTTONS) + int nbuttons = min(max(priv->nbuttons + 4, 7), WCM_MAX_BUTTONS); + if (prop->size != nbuttons) return BadMatch; wcmSetPropertyButtonActions(dev, property, prop, checkonly); } else -- cgit v1.2.3