summaryrefslogtreecommitdiff
path: root/synaptics.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-05-01 19:19:06 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:00:52 +0200
commit10c55ff9de415404201eb5ea37c10acfaca6f824 (patch)
treec8b2b8402268d35bbc5df6aeac7b3cd80ae8cd79 /synaptics.c
parent4cc36ca33128f17be57e3a58a44374d9558fbfe9 (diff)
Make double click processing from change
4cc36ca33128f17be57e3a58a44374d9558fbfe9 more reliable. In the old code, a very short click could generate a single click instead of a double click.
Diffstat (limited to 'synaptics.c')
-rw-r--r--synaptics.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/synaptics.c b/synaptics.c
index 9e5abdb..086e73f 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -510,6 +510,7 @@ ReadInput(LocalDevicePtr local)
double speed, integral;
int change;
int scroll_up, scroll_down, scroll_left, scroll_right;
+ int double_click;
/*
* set blocking to -1 on the first call because we know there is data to
@@ -585,6 +586,7 @@ ReadInput(LocalDevicePtr local)
}
/* Up/Down-button scrolling or middle/double-click */
+ double_click = FALSE;
if (!para->updown_button_scrolling)
{
if (down)
@@ -594,18 +596,11 @@ ReadInput(LocalDevicePtr local)
if (up)
{ /* up-button generates double-click */
- switch (DIFF_TIME(priv->count_packet, priv->count_double_click))
- { /* double click sequenz */
- case 1: left = TRUE; break;
- case 2: left = FALSE; break;
- case 3: left = TRUE; break;
- default: left = FALSE;
- }
- }
- else
- {
- priv->count_double_click = priv->count_packet;
+ if (!priv->prev_up)
+ double_click = TRUE;
}
+ priv->prev_up = up;
+
/* reset up/down button events */
up = down = FALSE;
}
@@ -951,6 +946,13 @@ ReadInput(LocalDevicePtr local)
xf86PostButtonEvent(local->dev, FALSE, 7, TRUE, 0, 0);
xf86PostButtonEvent(local->dev, FALSE, 7, FALSE, 0, 0);
}
+ if (double_click) {
+ int i;
+ for (i = 0; i < 2; i++) {
+ xf86PostButtonEvent(local->dev, FALSE, 1, !left, 0, 0);
+ xf86PostButtonEvent(local->dev, FALSE, 1, left, 0, 0);
+ }
+ }
}
}