From e5dde3cad4b397415b2014007f74bfbdc64babae Mon Sep 17 00:00:00 2001 From: Stephen Chandler Paul Date: Mon, 10 Mar 2014 18:33:20 -0400 Subject: [PATCH 2/2] Don't allow any type of movement starting in the top softbutton area Clicking in the top soft button area causes the trackpad to begin registering motion, even if the finger never leaves the top soft button area. We don't want this kind of behavior for the top soft button area, since it makes clicking and dragging items much more difficult when using a pointing stick. Signed-off-by: Stephen Chandler Paul --- src/synaptics.c | 14 +++++++++++--- src/synapticsstr.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/synaptics.c b/src/synaptics.c index 7cb7870..28ff673 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2812,6 +2812,9 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw, hw->left = 0; hw->middle = 1; } + if (priv->last_button_area == TOP_BUTTON_AREA) + priv->top_soft_button_held_down = TRUE; + priv->clickpad_click_millis = now; } else if (hw->left) { @@ -2819,6 +2822,8 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw, hw->middle = (priv->lastButtons & 2) ? 1 : 0; hw->right = (priv->lastButtons & 4) ? 1 : 0; } + else + priv->top_soft_button_held_down = FALSE; } /* Fingers emulate other buttons. ClickFinger can only be @@ -3110,7 +3115,8 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, /* If a physical button is pressed on a clickpad, use cumulative relative * touch movements for motion */ - if (para->clickpad && (hw->left || hw->right || hw->middle)) { + if (para->clickpad && (hw->left || hw->right || hw->middle) && + priv->last_button_area != TOP_BUTTON_AREA) { hw->x = hw->cumulative_dx; hw->y = hw->cumulative_dy; using_cumulative_coords = TRUE; @@ -3127,9 +3133,11 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, if (priv->finger_state < FS_TOUCHED) priv->last_button_area = current_button_area(para, hw->x, hw->y); /* If we already have a finger down, clear last_button_area if it goes - outside of the softbuttonareas */ + outside of the softbuttonareas unless it's leaving the top soft button + area */ else if (priv->last_button_area != NO_BUTTON_AREA && - current_button_area(para, hw->x, hw->y) == NO_BUTTON_AREA) + current_button_area(para, hw->x, hw->y) == NO_BUTTON_AREA && + !priv->top_soft_button_held_down) priv->last_button_area = NO_BUTTON_AREA; ignore_motion = diff --git a/src/synapticsstr.h b/src/synapticsstr.h index 8480397..51c33b9 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -261,6 +261,7 @@ struct _SynapticsPrivateRec { enum FingerState finger_state; /* previous finger state */ CARD32 last_motion_millis; /* time of the last motion */ enum SoftButtonAreas last_button_area; /* Last button area we were in */ + Bool top_soft_button_held_down; /* We're in a click that started from a top soft button*/ int clickpad_click_millis; /* Time of last clickpad click */ enum TapState tap_state; /* State of tap processing */ -- 1.8.3.2