summaryrefslogtreecommitdiff
path: root/src/properties.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-05-07 13:46:49 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-05-10 15:08:43 +1000
commitd79732c1ffcfa6fd1a9a39e5a1c464bba8e2afc8 (patch)
treee1d2eb91f81d5cbf70a11324e07a0f162cdd43d8 /src/properties.c
parentb8776ff0b478a1645f1536872d001e9605d86f71 (diff)
Make scrollbuttons processing and property conditional on their existence.
There are not a lot of touchpads that have extra physical scroll buttons anymore. For those that don't have them, don't initalize the properties and conditionalize some of the code (moved into its own functions). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/properties.c')
-rw-r--r--src/properties.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/properties.c b/src/properties.c
index 4366034..1134f7c 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -208,14 +208,18 @@ InitDeviceProperties(LocalDevicePtr local)
prop_edgemotion_speed = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32, 2, values);
prop_edgemotion_always = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION, 8, 1, &para->edge_motion_use_always);
- values[0] = para->updown_button_scrolling;
- values[1] = para->leftright_button_scrolling;
- prop_buttonscroll = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 2, values);
-
- values[0] = para->updown_button_repeat;
- values[1] = para->leftright_button_repeat;
- prop_buttonscroll_repeat = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 2, values);
- prop_buttonscroll_time = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 1, &para->scroll_button_repeat);
+ if (priv->has_scrollbuttons)
+ {
+ values[0] = para->updown_button_scrolling;
+ values[1] = para->leftright_button_scrolling;
+ prop_buttonscroll = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 2, values);
+
+ values[0] = para->updown_button_repeat;
+ values[1] = para->leftright_button_repeat;
+ prop_buttonscroll_repeat = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 2, values);
+ prop_buttonscroll_time = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 1, &para->scroll_button_repeat);
+ }
+
prop_off = InitAtom(local->dev, SYNAPTICS_PROP_OFF, 8, 1, &para->touchpad_off);
prop_guestmouse = InitAtom(local->dev, SYNAPTICS_PROP_GUESTMOUSE, 8, 1, &para->guestmouse_off);
prop_lockdrags = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 1, &para->locked_drags);
@@ -454,6 +458,9 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
{
BOOL *scroll;
+ if (!priv->has_scrollbuttons)
+ return BadMatch;
+
if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER)
return BadMatch;
@@ -465,6 +472,9 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
{
BOOL *repeat;
+ if (!priv->has_scrollbuttons)
+ return BadMatch;
+
if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER)
return BadMatch;
@@ -473,6 +483,9 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
para->leftright_button_repeat = repeat[1];
} else if (property == prop_buttonscroll_time)
{
+ if (!priv->has_scrollbuttons)
+ return BadMatch;
+
if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
return BadMatch;