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

Based on the patch by Tomas Janousek.

X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
This commit is contained in:
Peter Hutterer 2008-06-02 11:04:41 +09:30
parent ac1db45449
commit 26e7e69ab8

View File

@ -2074,7 +2074,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;
@ -2105,11 +2105,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 (x != pi->dixdev->last.valuators[0] ||
y != pi->dixdev->last.valuators[1])
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;