summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-02-19 18:30:35 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2014-02-20 14:17:38 +1000
commit945acfc261707be78cbc5438c22b061e20076004 (patch)
treefda35b8bc6e0b5389881561a9317d216d590f5e6
parent2ea76fad6545a712713de1a09965158805e83c55 (diff)
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: Juerd Waalboer <juerd@tnx.nl> Tested-by: Juerd Waalboer <juerd@tnx.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--man/synaptics.man15
-rw-r--r--src/synaptics.c11
2 files changed, 14 insertions, 12 deletions
diff --git a/man/synaptics.man b/man/synaptics.man
index 7da7527..a7889c7 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -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
diff --git a/src/synaptics.c b/src/synaptics.c
index 5794dae..1666045 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -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);