Commit 945acfc2 authored by Hans de Goede's avatar Hans de Goede Committed by Peter Hutterer
Browse files

Allow using the entire touchpad for motions started inside the active area



synaptics offers an option to make parts of the touchpad insensitive. This
is ie useful to do palm avoidance rather then palm detection (which may be
unreliable) by disabling an area of 15% on the right and left side of the
touchpad.

Currently a motion which has started inside the active area, stops as soon
as it moves outside of the active area.

If a motion started inside the active area and thus has already generated some
move events, this makes no sense. If the user moves outside of the active
area in this case, this is very likely because the user wants to continue
the motion.

This commit allows such motions to continue normally.

I would like to thank Juerd Waalboer for the basic idea, some coding and lots
of testing for this fix.

Cc: Juerd Waalboer <juerd@tnx.nl>
Reported-by: default avatarJuerd Waalboer <juerd@tnx.nl>
Tested-by: default avatarJuerd Waalboer <juerd@tnx.nl>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 2ea76fad
......@@ -441,7 +441,7 @@ Property: "Synaptics Pad Resolution"
.
.TP
.BI "Option \*qAreaLeftEdge\*q \*q" integer \*q
Ignore movements, scrolling and tapping which take place left of this edge.
Ignore movements, scrolling and tapping which start left of this edge.
.
The option is disabled by default and can be enabled by setting the
AreaLeftEdge option to any integer value other than zero. If supported by the
......@@ -450,7 +450,7 @@ the total width of the touchpad. Property: "Synaptics Area"
.
.TP
.BI "Option \*qAreaRightEdge\*q \*q" integer \*q
Ignore movements, scrolling and tapping which take place right of this edge.
Ignore movements, scrolling and tapping which start right of this edge.
.
The option is disabled by default and can be enabled by setting the
AreaRightEdge option to any integer value other than zero. If supported by the
......@@ -459,7 +459,7 @@ the total width of the touchpad. Property: "Synaptics Area"
.
.TP
.BI "Option \*qAreaTopEdge\*q \*q" integer \*q
Ignore movements, scrolling and tapping which take place above this edge.
Ignore movements, scrolling and tapping which start above this edge.
.
The option is disabled by default and can be enabled by setting the
AreaTopEdge option to any integer value other than zero. If supported by the
......@@ -468,7 +468,7 @@ the total height of the touchpad. Property: "Synaptics Area"
.
.TP
.BI "Option \*qAreaBottomEdge\*q \*q" integer \*q
Ignore movements, scrolling and tapping which take place below this edge.
Ignore movements, scrolling and tapping which start below this edge.
.
The option is disabled by default and can be enabled by setting the
AreaBottomEdge option to any integer value other than zero. If supported by the
......@@ -532,9 +532,10 @@ the touchpad.
.PP
The perceived physical edges may be adjusted with the AreaLeftEdge,
AreaRightEdge, AreaTopEdge, and AreaBottomEdge options. If these values are
set to something other than the physical edges, input in the space between
the area edge and the respective physical edge is ignored. Note that this
reduces the available space on the touchpad.
set to something other than the physical edges, input that starts in the
space between the area edge and the respective physical edge is ignored.
Note that this reduces the available space on the touchpad to start motions
in.
.SS Tapping
A tap event happens when the finger is touched and released in a time
interval shorter than MaxTapTime, and the touch and release
......
......@@ -1434,6 +1434,11 @@ is_inside_active_area(SynapticsPrivate * priv, int x, int y)
{
Bool inside_area = TRUE;
/* If a finger is down, then it must have started inside the active_area,
allow the motion to complete using the entire area */
if (priv->finger_state >= FS_TOUCHED)
return TRUE;
if ((priv->synpara.area_left_edge != 0) &&
(x < priv->synpara.area_left_edge))
inside_area = FALSE;
......@@ -3028,13 +3033,9 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
invalid are: x, y, z, numFingers, fingerWidth
valid are: millis, left/right/middle/up/down/etc.
*/
if (!inside_active_area) {
if (!inside_active_area)
reset_hw_state(hw);
/* FIXME: if finger accidentally moves into the area and doesn't
* really release, the finger should remain down. */
}
/* no edge or finger detection outside of area */
if (inside_active_area) {
edge = edge_detection(priv, hw->x, hw->y);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment