summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wcmXCommand.c3
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