summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-06-09 20:03:09 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2011-08-25 09:50:34 +1000
commit4fe1b58c2c6903961a84077363a0c8de5736c650 (patch)
tree0f6ed758848a2343e6950655db9e0ed0fae278bf
parentdf68486254b38b7f08f7d510ce1b75aaef9e52fd (diff)
Scroll: Modify ScrollData in repeat_scrollbuttons
repeat_scrollbuttons used to read the scroll repeat values and then post button events directly. Instead, make it modify ScrollData and let post_scroll_events take care of sending the scroll events, which requires moving the repeat_scrollbuttons call upwards. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 909be72..2f60322 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2440,7 +2440,8 @@ post_scroll_events(const InputInfoPtr pInfo, struct ScrollData scroll)
static inline int
repeat_scrollbuttons(const InputInfoPtr pInfo,
const struct SynapticsHwState *hw,
- int buttons, CARD32 now, int delay)
+ int buttons, CARD32 now, int delay,
+ struct ScrollData *sd)
{
SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private);
SynapticsParameters *para = &priv->synpara;
@@ -2477,8 +2478,14 @@ repeat_scrollbuttons(const InputInfoPtr pInfo,
while (change) {
id = ffs(change);
change &= ~(1 << (id - 1));
- xf86PostButtonEvent(pInfo->dev, FALSE, id, FALSE, 0, 0);
- xf86PostButtonEvent(pInfo->dev, FALSE, id, TRUE, 0, 0);
+ if (id == 4)
+ sd->up++;
+ else if (id == 5)
+ sd->down++;
+ else if (id == 6)
+ sd->left++;
+ else if (id == 7)
+ sd->right++;
}
priv->nextRepeat = now + repeat_delay;
@@ -2642,6 +2649,9 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
xf86PostButtonEvent(pInfo->dev, FALSE, id, (buttons & (1 << (id - 1))), 0, 0);
}
+ if (priv->has_scrollbuttons)
+ delay = repeat_scrollbuttons(pInfo, hw, buttons, now, delay, &scroll);
+
/* Process scroll events only if coordinates are
* in the Synaptics Area
*/
@@ -2657,9 +2667,6 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
post_button_click(pInfo, 1);
}
- if (priv->has_scrollbuttons)
- delay = repeat_scrollbuttons(pInfo, hw, buttons, now, delay);
-
/* Save old values of some state variables */
priv->finger_state = finger;
priv->lastButtons = buttons;