summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexandr Shadchin <shadchin@cvs.openbsd.org>2012-07-22 18:28:37 +0000
committerAlexandr Shadchin <shadchin@cvs.openbsd.org>2012-07-22 18:28:37 +0000
commit5f092dc002cc2a7e7b3823a322c47bad4b5576a1 (patch)
tree06ce71e04693feb5d35637f2f62a52a2975313bd /sys/dev
parent6788f329ad934c15c3ad2364385955c8f588de6b (diff)
Fix for ClickPad. On issue pointed gilles@ and matthieu@
ok gilles@, matthieu@, mpi@, miod@, deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pckbc/pms.c8
-rw-r--r--sys/dev/wscons/wsconsio.h3
-rw-r--r--sys/dev/wscons/wsmouse.c10
-rw-r--r--sys/dev/wscons/wsmousevar.h5
4 files changed, 19 insertions, 7 deletions
diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c
index d5087c0ad84..8d7105f1af7 100644
--- a/sys/dev/pckbc/pms.c
+++ b/sys/dev/pckbc/pms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pms.c,v 1.30 2012/07/01 12:59:34 mpi Exp $ */
+/* $OpenBSD: pms.c,v 1.31 2012/07/22 18:28:36 shadchin Exp $ */
/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -1026,7 +1026,8 @@ pms_proc_synaptics(struct pms_softc *sc)
if (syn->wsmode == WSMOUSE_NATIVE) {
wsmouse_input(sc->sc_wsmousedev, buttons, x, y, z, w,
WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
- WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W);
+ WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W |
+ WSMOUSE_INPUT_SYNC);
} else {
dx = dy = 0;
if (z > SYNAPTICS_PRESSURE) {
@@ -1335,7 +1336,8 @@ pms_proc_alps(struct pms_softc *sc)
wsmouse_input(sc->sc_wsmousedev, buttons, x, y, z, w,
WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
- WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W);
+ WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W |
+ WSMOUSE_INPUT_SYNC);
alps->old_fin = fin;
} else {
diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h
index c743093137f..9f222c0bfc6 100644
--- a/sys/dev/wscons/wsconsio.h
+++ b/sys/dev/wscons/wsconsio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsconsio.h,v 1.65 2012/04/17 08:51:24 miod Exp $ */
+/* $OpenBSD: wsconsio.h,v 1.66 2012/07/22 18:28:36 shadchin Exp $ */
/* $NetBSD: wsconsio.h,v 1.74 2005/04/28 07:15:44 martin Exp $ */
/*
@@ -80,6 +80,7 @@ struct wscons_event {
/* 12-15, see below */
#define WSCONS_EVENT_MOUSE_DELTA_W 16 /* W delta amount */
#define WSCONS_EVENT_MOUSE_ABSOLUTE_W 17 /* W location */
+#define WSCONS_EVENT_SYNC 18
/*
* Following events are not real wscons_event but are used as parameters of the
* WSDISPLAYIO_WSMOUSED ioctl
diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c
index e5c72b09732..8985e053185 100644
--- a/sys/dev/wscons/wsmouse.c
+++ b/sys/dev/wscons/wsmouse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmouse.c,v 1.22 2011/08/17 16:10:27 shadchin Exp $ */
+/* $OpenBSD: wsmouse.c,v 1.23 2012/07/22 18:28:36 shadchin Exp $ */
/* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -455,6 +455,14 @@ wsmouse_input(struct device *wsmousedev, u_int btns, /* 0 is up */
ub ^= d;
}
+ if (flags & WSMOUSE_INPUT_SYNC) {
+ NEXT;
+ ev->type = WSCONS_EVENT_SYNC;
+ ev->value = 0;
+ TIMESTAMP;
+ ADVANCE;
+ }
+
/* XXX fake wscons_event notifying wsmoused(8) to close mouse device */
if (flags & WSMOUSE_INPUT_WSMOUSED_CLOSE) {
NEXT;
diff --git a/sys/dev/wscons/wsmousevar.h b/sys/dev/wscons/wsmousevar.h
index 99e83e9db20..68d8f342b94 100644
--- a/sys/dev/wscons/wsmousevar.h
+++ b/sys/dev/wscons/wsmousevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmousevar.h,v 1.5 2007/04/10 22:37:17 miod Exp $ */
+/* $OpenBSD: wsmousevar.h,v 1.6 2012/07/22 18:28:36 shadchin Exp $ */
/* $NetBSD: wsmousevar.h,v 1.4 2000/01/08 02:57:24 takemura Exp $ */
/*
@@ -71,9 +71,10 @@ int wsmousedevprint(void *, const char *);
#define WSMOUSE_INPUT_ABSOLUTE_X (1<<0)
#define WSMOUSE_INPUT_ABSOLUTE_Y (1<<1)
#define WSMOUSE_INPUT_ABSOLUTE_Z (1<<2)
-#define WSMOUSE_INPUT_ABSOLUTE_W (1<<4)
#define WSMOUSE_INPUT_WSMOUSED_CLOSE (1<<3) /* notify wsmoused(8) to close
mouse device */
+#define WSMOUSE_INPUT_ABSOLUTE_W (1<<4)
+#define WSMOUSE_INPUT_SYNC (1<<5)
void wsmouse_input(struct device *kbddev, u_int btns,
int x, int y, int z, int w, u_int flags);