kdrive: don't post motion event if there was no motion. #16179

Based on the patch by Tomas Janousek. Backported version.

X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
(cherry picked from commit 26e7e69ab8)
This commit is contained in:
Peter Hutterer 2008-06-02 11:04:41 +09:30 committed by Peter Hutterer
parent a75cbabc25
commit 0baf677da6

View File

@ -2078,7 +2078,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;
@ -2109,11 +2109,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;
{
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;
_KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
if (dixflags)
_KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
buttons = flags;