[PATCH synaptics 04/10] Purge edge motion

Peter Hutterer peter.hutterer at who-t.net
Tue May 8 22:34:32 PDT 2012


A funny feature, but unreliable and mostly untested.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 include/synaptics-properties.h |    9 ------
 man/synaptics.man              |   68 +++++++-------------------------------
 src/properties.c               |   49 ----------------------------
 src/synaptics.c                |   70 ++--------------------------------------
 src/synapticsstr.h             |    5 ---
 tools/synclient.c              |    5 ---
 6 files changed, 13 insertions(+), 193 deletions(-)

diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
index 984dc03..19bd2b2 100644
--- a/include/synaptics-properties.h
+++ b/include/synaptics-properties.h
@@ -75,15 +75,6 @@
 /* FLOAT, 4 values, min, max, accel, <deprecated> */
 #define SYNAPTICS_PROP_SPEED "Synaptics Move Speed"
 
-/* 32 bit, 2 values, min, max */
-#define SYNAPTICS_PROP_EDGEMOTION_PRESSURE "Synaptics Edge Motion Pressure"
-
-/* 32 bit, 2 values, min, max */
-#define SYNAPTICS_PROP_EDGEMOTION_SPEED "Synaptics Edge Motion Speed"
-
-/* 8 bit (BOOL) */
-#define SYNAPTICS_PROP_EDGEMOTION "Synaptics Edge Motion Always"
-
 /* 8 bit (BOOL), 2 values, updown, leftright */
 #define SYNAPTICS_PROP_BUTTONSCROLLING "Synaptics Button Scrolling"
 
diff --git a/man/synaptics.man b/man/synaptics.man
index 0e8870d..d7dd779 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -160,26 +160,6 @@ Distance"
 .BI "Option \*qHorizScrollDelta\*q \*q" integer \*q
 Move distance of the finger for a scroll event. Property: "Synaptics Scrolling
 Distance"
-.TP 7
-.BI "Option \*qEdgeMotionMinZ\*q \*q" integer \*q
-Finger pressure at which minimum edge motion speed is set. Property:
-"Synaptics Edge Motion Pressure"
-.TP
-.BI "Option \*qEdgeMotionMaxZ\*q \*q" integer \*q
-Finger pressure at which maximum edge motion speed is set. Property:
-"Synaptics Edge Motion Pressure"
-.TP
-.BI "Option \*qEdgeMotionMinSpeed\*q \*q" integer \*q
-Slowest setting for edge motion speed. Property: "Synaptics Edge Motion Speed"
-.TP
-.BI "Option \*qEdgeMotionMaxSpeed\*q \*q" integer \*q
-Fastest setting for edge motion speed. Property: "Synaptics Edge Motion Speed"
-.TP
-.BI "Option \*qEdgeMotionUseAlways\*q \*q" boolean \*q
-If on, edge motion is also used for normal movements.
-.
-If off, edge motion is used only when dragging. Property: "Synaptics Edge
-Motion Always"
 .TP
 .BI "Option \*qMinSpeed\*q \*q" float \*q
 Minimum speed factor. Property: "Synaptics Move Speed"
@@ -633,34 +613,9 @@ If the pressure is below PressureMotionMinZ, PressureMotionMinFactor
 is used, and if the pressure is greater than PressureMotionMaxZ,
 PressureMotionMaxFactor is used.
 .
-By default, PressureMotionMinZ and PressureMotionMaxZ are equal to
-EdgeMotionMinZ and EdgeMotionMaxZ.
-.
 For a pressure value between PressureMotionMinZ and
 PressureMotionMaxZ, the factor is increased linearly.
 .
-.SS Edge motion
-When hitting an edge, movement can be automatically continued.
-.
-If EdgeMotionUseAlways is false, edge motion is only used when
-dragging.
-.
-With EdgeMotionUseAlways set to true, it is also used for normal
-cursor movements.
-.
-.LP
-Edge motion speed is calculated by taking into account the amount of
-pressure applied to the touchpad.
-.
-The sensitivity can be adjusted using the EdgeMotion parameters.
-.
-If the pressure is below EdgeMotionMinZ, EdgeMotionMinSpeed is used,
-and if the pressure is greater than EdgeMotionMaxZ, EdgeMotionMaxSpeed
-is used.
-.
-For a pressure value between EdgeMotionMinZ and EdgeMotionMaxZ, the
-speed is increased linearly.
-.
 .SS Middle button emulation
 Since most synaptics touchpad models don't have a button that
 corresponds to the middle button on a mouse, the driver can emulate
@@ -814,18 +769,6 @@ duration of a single click.
 FLOAT, 4 values, min, max, accel, <deprecated>
 
 .TP 7
-.BI "Synaptics Edge Motion Pressure"
-32 bit, 2 values, min, max.
-
-.TP 7
-.BI "Synaptics Edge Motion Speed"
-32 bit, 2 values, min, max.
-
-.TP 7
-.BI "Synaptics Edge Motion Always"
-8 bit (BOOL).
-
-.TP 7
 .BI "Synaptics Button Scrolling"
 8 bit (BOOL), 2 values, updown, leftright.
 
@@ -984,6 +927,17 @@ The following options are no longer part of the driver configuration:
 .BI "Option \*qTrackstickSpeed\*q \*q" float \*q
 .TP
 .BI "Option \*qFastTaps\*q \*q" boolean \*q
+.TP
+.BI "Option \*qEdgeMotionMinZ\*q \*q" integer \*q
+.TP
+.BI "Option \*qEdgeMotionMaxZ\*q \*q" integer \*q
+.TP
+.BI "Option \*qEdgeMotionMinSpeed\*q \*q" integer \*q
+.TP
+.BI "Option \*qEdgeMotionMaxSpeed\*q \*q" integer \*q
+.TP
+.BI "Option \*qEdgeMotionUseAlways\*q \*q" boolean \*q
+
 
 .SH "AUTHORS"
 .LP
diff --git a/src/properties.c b/src/properties.c
index e89147f..0c422fb 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -251,19 +251,6 @@ InitDeviceProperties(InputInfoPtr pInfo)
     fvalues[3] = 0;
     prop_speed = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_SPEED, 4, fvalues);
 
-    values[0] = para->edge_motion_min_z;
-    values[1] = para->edge_motion_max_z;
-    prop_edgemotion_pressure =
-        InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGEMOTION_PRESSURE, 32, 2, values);
-
-    values[0] = para->edge_motion_min_speed;
-    values[1] = para->edge_motion_max_speed;
-    prop_edgemotion_speed =
-        InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32, 2, values);
-    prop_edgemotion_always =
-        InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGEMOTION, 8, 1,
-                 &para->edge_motion_use_always);
-
     if (priv->has_scrollbuttons) {
         values[0] = para->updown_button_scrolling;
         values[1] = para->leftright_button_scrolling;
@@ -554,42 +541,6 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
         para->min_speed = speed[0];
         para->max_speed = speed[1];
         para->accl = speed[2];
-
-    }
-    else if (property == prop_edgemotion_pressure) {
-        CARD32 *pressure;
-
-        if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
-            return BadMatch;
-
-        pressure = (CARD32 *) prop->data;
-        if (pressure[0] > pressure[1])
-            return BadValue;
-
-        para->edge_motion_min_z = pressure[0];
-        para->edge_motion_max_z = pressure[1];
-
-    }
-    else if (property == prop_edgemotion_speed) {
-        CARD32 *speed;
-
-        if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
-            return BadMatch;
-
-        speed = (CARD32 *) prop->data;
-        if (speed[0] > speed[1])
-            return BadValue;
-
-        para->edge_motion_min_speed = speed[0];
-        para->edge_motion_max_speed = speed[1];
-
-    }
-    else if (property == prop_edgemotion_always) {
-        if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
-            return BadMatch;
-
-        para->edge_motion_use_always = *(BOOL *) prop->data;
-
     }
     else if (property == prop_buttonscroll) {
         BOOL *scroll;
diff --git a/src/synaptics.c b/src/synaptics.c
index bb52b2b..64da2c6 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -529,12 +529,10 @@ set_default_parameters(InputInfoPtr pInfo)
     int horizScrollDelta, vertScrollDelta;      /* pixels */
     int tapMove;                /* pixels */
     int l, r, t, b;             /* left, right, top, bottom */
-    int edgeMotionMinSpeed, edgeMotionMaxSpeed; /* pixels/second */
     double accelFactor;         /* 1/pixels */
     int fingerLow, fingerHigh;  /* pressure */
     int emulateTwoFingerMinZ;   /* pressure */
     int emulateTwoFingerMinW;   /* width */
-    int edgeMotionMinZ, edgeMotionMaxZ; /* pressure */
     int pressureMotionMinZ, pressureMotionMaxZ; /* pressure */
     int palmMinWidth, palmMinZ; /* pressure */
     int tapButton1, tapButton2, tapButton3;
@@ -568,8 +566,6 @@ set_default_parameters(InputInfoPtr pInfo)
     horizScrollDelta = diag * .020;
     vertScrollDelta = diag * .020;
     tapMove = diag * .044;
-    edgeMotionMinSpeed = 1;
-    edgeMotionMaxSpeed = diag * .080;
     accelFactor = 200.0 / diag; /* trial-and-error */
 
     /* hysteresis, assume >= 0 is a detected value (e.g. evdev fuzz) */
@@ -582,8 +578,6 @@ set_default_parameters(InputInfoPtr pInfo)
 
     /* scaling based on defaults and a pressure of 256 */
     emulateTwoFingerMinZ = priv->minp + range * (282.0 / 256);
-    edgeMotionMinZ = priv->minp + range * (30.0 / 256);
-    edgeMotionMaxZ = priv->minp + range * (160.0 / 256);
     pressureMotionMinZ = priv->minp + range * (30.0 / 256);
     pressureMotionMaxZ = priv->minp + range * (160.0 / 256);
     palmMinZ = priv->minp + range * (200.0 / 256);
@@ -667,16 +661,7 @@ set_default_parameters(InputInfoPtr pInfo)
         xf86SetBoolOption(opts, "VertTwoFingerScroll", vertTwoFingerScroll);
     pars->scroll_twofinger_horiz =
         xf86SetBoolOption(opts, "HorizTwoFingerScroll", horizTwoFingerScroll);
-    pars->edge_motion_min_z =
-        xf86SetIntOption(opts, "EdgeMotionMinZ", edgeMotionMinZ);
-    pars->edge_motion_max_z =
-        xf86SetIntOption(opts, "EdgeMotionMaxZ", edgeMotionMaxZ);
-    pars->edge_motion_min_speed =
-        xf86SetIntOption(opts, "EdgeMotionMinSpeed", edgeMotionMinSpeed);
-    pars->edge_motion_max_speed =
-        xf86SetIntOption(opts, "EdgeMotionMaxSpeed", edgeMotionMaxSpeed);
-    pars->edge_motion_use_always =
-        xf86SetBoolOption(opts, "EdgeMotionUseAlways", FALSE);
+
     if (priv->has_scrollbuttons) {
         pars->updown_button_scrolling =
             xf86SetBoolOption(opts, "UpDownScrolling", TRUE);
@@ -2159,57 +2144,9 @@ hysteresis(int in, int center, int margin)
 }
 
 static void
-get_edge_speed(SynapticsPrivate * priv, const struct SynapticsHwState *hw,
-               edge_type edge, int *x_edge_speed, int *y_edge_speed)
-{
-    SynapticsParameters *para = &priv->synpara;
-
-    int minZ = para->edge_motion_min_z;
-    int maxZ = para->edge_motion_max_z;
-    int minSpd = para->edge_motion_min_speed;
-    int maxSpd = para->edge_motion_max_speed;
-    int edge_speed;
-
-    if (hw->z <= minZ) {
-        edge_speed = minSpd;
-    }
-    else if (hw->z >= maxZ) {
-        edge_speed = maxSpd;
-    }
-    else {
-        edge_speed =
-            minSpd + (hw->z - minZ) * (maxSpd - minSpd) / (maxZ - minZ);
-    }
-    if (!priv->synpara.circular_pad) {
-        /* on rectangular pad */
-        if (edge & RIGHT_EDGE) {
-            *x_edge_speed = edge_speed;
-        }
-        else if (edge & LEFT_EDGE) {
-            *x_edge_speed = -edge_speed;
-        }
-        if (edge & TOP_EDGE) {
-            *y_edge_speed = -edge_speed;
-        }
-        else if (edge & BOTTOM_EDGE) {
-            *y_edge_speed = edge_speed;
-        }
-    }
-    else if (edge) {
-        /* at edge of circular pad */
-        double relX, relY;
-
-        relative_coords(priv, hw->x, hw->y, &relX, &relY);
-        *x_edge_speed = (int) (edge_speed * relX);
-        *y_edge_speed = (int) (edge_speed * relY);
-    }
-}
-
-static void
-get_delta(SynapticsPrivate * priv, const struct SynapticsHwState *hw,
+get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
           edge_type edge, double *dx, double *dy)
 {
-    SynapticsParameters *para = &priv->synpara;
     double dtime = (hw->millis - HIST(0).millis) / 1000.0;
     double integral;
     double tmpf;
@@ -2219,9 +2156,6 @@ get_delta(SynapticsPrivate * priv, const struct SynapticsHwState *hw,
     *dx = hw->x - HIST(0).x;
     *dy = hw->y - HIST(0).y;
 
-    if ((priv->tap_state == TS_DRAG) || para->edge_motion_use_always)
-        get_edge_speed(priv, hw, edge, &x_edge_speed, &y_edge_speed);
-
     /* report edge speed as synthetic motion. Of course, it would be
      * cooler to report floats than to buffer, but anyway. */
 
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 2dbc054..5e85a3b 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -137,11 +137,6 @@ typedef struct _SynapticsParameters {
     Bool scroll_twofinger_vert; /* Enable/disable vertical two-finger scrolling */
     Bool scroll_twofinger_horiz;        /* Enable/disable horizontal two-finger scrolling */
     double min_speed, max_speed, accl;  /* movement parameters */
-    int edge_motion_min_z;      /* finger pressure at which minimum edge motion speed is set */
-    int edge_motion_max_z;      /* finger pressure at which maximum edge motion speed is set */
-    int edge_motion_min_speed;  /* slowest setting for edge motion speed */
-    int edge_motion_max_speed;  /* fastest setting for edge motion speed */
-    Bool edge_motion_use_always;        /* If false, edge motion is used only when dragging */
 
     Bool updown_button_scrolling;       /* Up/Down-Button scrolling or middle/double-click */
     Bool leftright_button_scrolling;    /* Left/right-button scrolling, or two lots of middle button */
diff --git a/tools/synclient.c b/tools/synclient.c
index fd73d60..7ea702d 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -97,11 +97,6 @@ static struct Parameter params[] = {
     {"MinSpeed",              PT_DOUBLE, 0, 255.0,   SYNAPTICS_PROP_SPEED,	0, /*float */	0},
     {"MaxSpeed",              PT_DOUBLE, 0, 255.0,   SYNAPTICS_PROP_SPEED,	0, /*float */	1},
     {"AccelFactor",           PT_DOUBLE, 0, 1.0,   SYNAPTICS_PROP_SPEED,	0, /*float */	2},
-    {"EdgeMotionMinZ",        PT_INT,    1, 255,   SYNAPTICS_PROP_EDGEMOTION_PRESSURE,  32,	0},
-    {"EdgeMotionMaxZ",        PT_INT,    1, 255,   SYNAPTICS_PROP_EDGEMOTION_PRESSURE,  32,	1},
-    {"EdgeMotionMinSpeed",    PT_INT,    0, 1000,  SYNAPTICS_PROP_EDGEMOTION_SPEED,     32,	0},
-    {"EdgeMotionMaxSpeed",    PT_INT,    0, 1000,  SYNAPTICS_PROP_EDGEMOTION_SPEED,     32,	1},
-    {"EdgeMotionUseAlways",   PT_BOOL,   0, 1,     SYNAPTICS_PROP_EDGEMOTION,   8,	0},
     {"UpDownScrolling",       PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING,  8,	0},
     {"LeftRightScrolling",    PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING,  8,	1},
     {"UpDownScrollRepeat",    PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT,   8,	0},
-- 
1.7.10.1



More information about the xorg-devel mailing list