summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor P. Goncharov (Fredy) <fedgo@gorodok.net>2008-12-04 17:16:40 +0600
committerPeter Hutterer <peter.hutterer@who-t.net>2008-12-15 09:31:56 +1000
commit3db3f4e04c7038477a03b092c55dfd063224f034 (patch)
treeb82f8e7390e53e855ee6af75a95cef93482c423f
parent8d0767d27e17fcda8a75b993033dfbc1a7cb3720 (diff)
Auto-adjust right_edge for touchpads with hardware scroll area.
If RightEdge is specified as a config option, ignore the SpecialScrollArea. Otherwise, adjust right_edge to the bounds of the hardware scroll area. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Christoph Brill <egore911@egore911.de> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> (cherry picked from commit 0f2802726fe7374afeca7447e3127bc1d7f3247c)
-rw-r--r--man/synaptics.man9
-rw-r--r--src/synaptics.c36
2 files changed, 19 insertions, 26 deletions
diff --git a/man/synaptics.man b/man/synaptics.man
index 79958e7..0030680 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -101,7 +101,9 @@ user can access the configuration.
X coordinate for left edge.
.TP 7
.BI "Option \*qRightEdge\*q \*q" integer \*q
-X coordinate for right edge.
+X coordinate for right edge. If this option is set,
+.BI SpecialScrollAreaRight
+is ignored.
.TP 7
.BI "Option \*qTopEdge\*q \*q" integer \*q
Y coordinate for top edge.
@@ -110,9 +112,8 @@ Y coordinate for top edge.
Y coordinate for bottom edge.
.TP 7
.BI "Option \*qSpecialScrollAreaRight\*q \*q" boolean \*q
-Detect special scroll wheel region and set coordinate automaticly (region
-must have a very large X coordinate). Disable option if you don't want use
-it region.
+Some touchpads have a scroll region on the right edge. Disable this option if
+you have one but don't want use it as scroll wheel region.
.TP 7
.BI "Option \*qFingerLow\*q \*q" integer \*q
When finger pressure drops below this value, the driver counts it as a
diff --git a/src/synaptics.c b/src/synaptics.c
index 6419607..8ccfb69 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -441,7 +441,11 @@ static void set_default_parameters(LocalDevicePtr local)
pars->scroll_dist_vert = xf86SetIntOption(opts, "VertScrollDelta", horizScrollDelta);
pars->scroll_dist_horiz = xf86SetIntOption(opts, "HorizScrollDelta", vertScrollDelta);
pars->scroll_edge_vert = xf86SetBoolOption(opts, "VertEdgeScroll", vertEdgeScroll);
- pars->special_scroll_area_right = xf86SetBoolOption(opts, "SpecialScrollAreaRight", TRUE);
+ if (xf86CheckIfOptionUsedByName(opts, "RightEdge")) {
+ pars->special_scroll_area_right = FALSE;
+ } else {
+ pars->special_scroll_area_right = xf86SetBoolOption(opts, "SpecialScrollAreaRight", TRUE);
+ }
pars->scroll_edge_horiz = xf86SetBoolOption(opts, "HorizEdgeScroll", horizEdgeScroll);
pars->scroll_edge_corner = xf86SetBoolOption(opts, "CornerCoasting", FALSE);
pars->scroll_twofinger_vert = xf86SetBoolOption(opts, "VertTwoFingerScroll", vertTwoFingerScroll);
@@ -891,7 +895,7 @@ edge_detection(SynapticsPrivate *priv, int x, int y)
if (priv->synpara->circular_pad)
return circular_edge_detection(priv, x, y);
- if (x >= priv->synpara->right_edge)
+ if (x > priv->synpara->right_edge)
edge |= RIGHT_EDGE;
else if (x < priv->synpara->left_edge)
edge |= LEFT_EDGE;
@@ -1970,32 +1974,20 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
/*
* Some touchpads have a scroll wheel region where a very large X
- * coordinate is reported.
- *
- * We suggest two solution this problem:
+ * coordinate is reported. In this case for eliminate discontinuity,
+ * we adjust X and simulate new zone which adjacent to right edge.
*/
if (hw->x <= XMAX_VALID) {
if (priv->largest_valid_x < hw->x)
priv->largest_valid_x = hw->x;
} else {
- if (!(para->special_scroll_area_right))
- /* First:
- * Adjust the X coordinate to eliminate the discontinuity
- * and use it region as 1 coordinate size line.
- */
- hw->x = priv->largest_valid_x + 1;
- else {
- /* Second (default):
- * Adjust the X coordinate to eliminate the discontinuity
- * and use it region as scroll area automaticly.
- */
-
- if (priv->synpara->right_edge > priv->largest_valid_x + 1)
- priv->synpara->right_edge=priv->largest_valid_x + 1;
- para->special_scroll_area_right = FALSE;
-
hw->x = priv->largest_valid_x + 1;
- }
+ /*
+ * If user didn't set right_edge manualy, auto-adjust to bounds of
+ * hardware scroll area.
+ */
+ if (para->special_scroll_area_right)
+ priv->synpara->right_edge = priv->largest_valid_x;
}
edge = edge_detection(priv, hw->x, hw->y);