diff options
author | Fedor P. Goncharov (Fredy) <fedgo@gorodok.net> | 2008-12-04 17:16:40 +0600 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2008-12-12 11:27:31 +1000 |
commit | 0f2802726fe7374afeca7447e3127bc1d7f3247c (patch) | |
tree | 9956beaaa34693ad0955eec5af1ede380bc99e82 /src | |
parent | 9e84eb6bd2010176c11022cb8c0af56c6e9d7663 (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>
Diffstat (limited to 'src')
-rw-r--r-- | src/synaptics.c | 36 |
1 files changed, 14 insertions, 22 deletions
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); |