summaryrefslogtreecommitdiff
path: root/driver/xf86-input-synaptics
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-02-09 03:31:32 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-02-09 03:31:32 +0000
commit4454e867a343adc09d8a82cf3db0abe52be1b800 (patch)
treec90fbb29a61fb4ce1faa2dd71aac5c0ee3b4b28f /driver/xf86-input-synaptics
parent2f2c44403587dcecd3383833ef770d078f878ba4 (diff)
Keep cumulative coordinates values in sync with absolute ones.
This improve "two-finger scrolling" on synaptics and will allow to have proper "click-and-drag" support on elantech. Note that this change is needed because wsmouse(4)/wscons(4) do not support multitouch events for the moment and every protocol supported by pms(4) do its own translation to fake such events. From Ulf Brosziewski, ok shadchin@
Diffstat (limited to 'driver/xf86-input-synaptics')
-rw-r--r--driver/xf86-input-synaptics/src/wsconscomm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/driver/xf86-input-synaptics/src/wsconscomm.c b/driver/xf86-input-synaptics/src/wsconscomm.c
index 64489588f..f6b9d88d4 100644
--- a/driver/xf86-input-synaptics/src/wsconscomm.c
+++ b/driver/xf86-input-synaptics/src/wsconscomm.c
@@ -132,12 +132,6 @@ WSConsReadHwState(InputInfoPtr pInfo,
struct wscons_event event;
Bool v;
- /* Reset cumulative values if buttons were not previously pressed */
- if (!hw->left && !hw->right && !hw->middle) {
- hw->cumulative_dx = hw->x;
- hw->cumulative_dy = hw->y;
- }
-
while (WSConsReadEvent(pInfo, &event)) {
switch (event.type) {
case WSCONS_EVENT_MOUSE_UP:
@@ -187,9 +181,11 @@ WSConsReadHwState(InputInfoPtr pInfo,
break;
case WSCONS_EVENT_MOUSE_ABSOLUTE_X:
hw->x = event.value;
+ hw->cumulative_dx = hw->x;
break;
case WSCONS_EVENT_MOUSE_ABSOLUTE_Y:
hw->y = priv->maxy - event.value + priv->miny;
+ hw->cumulative_dy = hw->y;
break;
case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
hw->z = event.value;
@@ -218,6 +214,10 @@ WSConsReadHwState(InputInfoPtr pInfo,
}
break;
case WSCONS_EVENT_SYNC:
+ if (hw->z == 0) {
+ hw->fingerWidth = 0;
+ hw->numFingers = 0;
+ }
hw->millis = 1000 * event.time.tv_sec + event.time.tv_nsec / 1000000;
SynapticsCopyHwState(hwRet, hw);
return TRUE;