Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons Mouse move event should be made before mouse ...



details:   https://anonhg.NetBSD.org/src/rev/83c8d28bcea1
branches:  trunk
changeset: 485569:83c8d28bcea1
user:      takemura <takemura%NetBSD.org@localhost>
date:      Mon May 01 07:36:58 2000 +0000

description:
Mouse move event should be made before mouse bown event. Without that,
you may got a mouse down event in strange plase.

diffstat:

 sys/dev/wscons/wsmouse.c |  43 ++++++++++++++++++++++---------------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diffs (71 lines):

diff -r a3a8fff3966e -r 83c8d28bcea1 sys/dev/wscons/wsmouse.c
--- a/sys/dev/wscons/wsmouse.c  Mon May 01 05:33:55 2000 +0000
+++ b/sys/dev/wscons/wsmouse.c  Mon May 01 07:36:58 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmouse.c,v 1.11 2000/01/08 02:57:24 takemura Exp $ */
+/* $NetBSD: wsmouse.c,v 1.12 2000/05/01 07:36:58 takemura Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.11 2000/01/08 02:57:24 takemura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.12 2000/05/01 07:36:58 takemura Exp $");
 
 /*
  * Copyright (c) 1992, 1993
@@ -350,25 +350,6 @@
                splx(s);                                                \
        } while (0)
 
-       mb = sc->sc_mb;
-       ub = sc->sc_ub;
-       while ((d = mb ^ ub) != 0) {
-               /*
-                * Mouse button change.  Find the first change and drop
-                * it into the event queue.
-                */
-               NEXT;
-               ev->value = ffs(d) - 1;
-
-               KASSERT(ev->value >= 0);
-
-               d = 1 << ev->value;
-               ev->type =
-                   (mb & d) ? WSCONS_EVENT_MOUSE_DOWN : WSCONS_EVENT_MOUSE_UP;
-               TIMESTAMP;
-               ADVANCE;
-               ub ^= d;
-       }
        if (flags & WSMOUSE_INPUT_ABSOLUTE_X) {
                if (sc->sc_x != x) {
                        NEXT;
@@ -426,6 +407,26 @@
                        sc->sc_dz = 0;
                }
        }
+
+       mb = sc->sc_mb;
+       ub = sc->sc_ub;
+       while ((d = mb ^ ub) != 0) {
+               /*
+                * Mouse button change.  Find the first change and drop
+                * it into the event queue.
+                */
+               NEXT;
+               ev->value = ffs(d) - 1;
+
+               KASSERT(ev->value >= 0);
+
+               d = 1 << ev->value;
+               ev->type =
+                   (mb & d) ? WSCONS_EVENT_MOUSE_DOWN : WSCONS_EVENT_MOUSE_UP;
+               TIMESTAMP;
+               ADVANCE;
+               ub ^= d;
+       }
 out:
        if (any) {
                sc->sc_ub = ub;



Home | Main Index | Thread Index | Old Index