diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-09 17:26:00 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-10 16:58:08 +1030 |
commit | 18cdd733ad3dd36fa0a23dfbf18c7d99b86c0276 (patch) | |
tree | 59b74a3e88e98c765fab59b552b88a7c87f35677 /hw/kdrive | |
parent | d58f2c30c64e8b2d8179dac06e0a54be06099da6 (diff) |
kdrive: fix dixflags so they're always defined before enqueuing events #17734
If absolute events were posted, dixflags got set conditionally on whether the
valuators are different from the last posted set of values.
If dixflags are undefined however, the DIX interprets them as relative
valuators. Fix this by making sure defining dixflags is always defined.
X.Org Bug 17724 <http://bugs.freedesktop.org/show_bug.cgi?id=17734>
Diffstat (limited to 'hw/kdrive')
-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 8a1380fbe..15fd3b7e7 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2105,13 +2105,17 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, if (flags & KD_MOUSE_DELTA) { 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; - - if (dixflags) - _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + } + } else + { + dixflags = POINTER_ABSOLUTE; + if (x != pi->dixdev->last.valuators[0] || + y != pi->dixdev->last.valuators[1]) + _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + } buttons = flags; |