diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-02-09 11:07:39 -0800 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2012-02-16 17:56:23 -0800 |
commit | 6240c226ef429ade3926be0a65341117de2b24e5 (patch) | |
tree | 6fefd277be9d9b71c1ace4680dc69155e0c9514e | |
parent | 5a2221de13f73c7edbe4221909225ef5c7c5c18a (diff) |
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 <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/wcmXCommand.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 |