diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-02 11:04:41 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-28 20:31:39 +0930 |
commit | 5903b4c749c1136d0f3e91d5e6321b08c31da4bf (patch) | |
tree | 01c9f1876d7762273fec0cff3ff7a10d9019b129 | |
parent | c3a7903f6a6a27e53ba0372408e0c5a68c608e86 (diff) |
kdrive: don't post motion event if there was no motion. #16179
Based on the patch by Tomas Janousek.
Backported from master to server-1.4.
X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
(cherry picked from commit 26e7e69ab893d1f2b35213250ada40ec90944f62)
-rw-r--r-- | hw/kdrive/src/kinput.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 6c247c185..d53a0d99a 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2066,7 +2066,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, int (*matrix)[3] = kdPointerMatrix.matrix; unsigned long button; int n; - int dixflags; + int dixflags = 0; if (!pi) return; @@ -2097,11 +2097,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, z = rz; if (flags & KD_MOUSE_DELTA) - dixflags = POINTER_RELATIVE & POINTER_ACCELERATE; - else - dixflags = POINTER_ABSOLUTE; - - _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + { + if (x || y || z) + dixflags = POINTER_RELATIVE | POINTER_ACCELERATE; + } else if ((pi->dixdev->valuator) && (x != pi->dixdev->valuator->lastx || + y != pi->dixdev->valuator->lasty)) + dixflags = POINTER_ABSOLUTE; + + if (dixflags) + _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); buttons = flags; |