summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-02-05 00:46:48 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-10 09:42:30 +1000
commit54f65f3ca1f7a7118bea96915d79acee28721581 (patch)
tree8123f224b7cbecc40594deb48c7984814fa793d7 /src
parentd14ea867ad5d6f8a758a18223e457e1a56fa6065 (diff)
Purge edge motion
A funny feature, but unreliable and mostly untested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src')
-rw-r--r--src/properties.c49
-rw-r--r--src/synaptics.c70
-rw-r--r--src/synapticsstr.h5
3 files changed, 2 insertions, 122 deletions
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 */