summary refs log tree commit diff stats
path: root/hw/input/hid.c
diff options
context:
space:
mode:
authorChristian Burger <christian@krikkel.de>2014-06-14 20:19:41 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-07-01 13:26:37 +0200
commit35e83d10f230616888cc4258ceddf06a612dde8a (patch)
tree5e6352f53d387413c3ae1d60ce2ada02d99c98e6 /hw/input/hid.c
parentb3959efdbb2dc3d5959e3b0a8e188126930beca8 (diff)
downloadfocaccia-qemu-35e83d10f230616888cc4258ceddf06a612dde8a.tar.gz
focaccia-qemu-35e83d10f230616888cc4258ceddf06a612dde8a.zip
input: fix jumpy mouse cursor with USB mouse emulation
Guest mouse pointer was jumpy, when moving host mouse in the vertical direction (see bug #1327800).

Signed-off-by: Christian Burger <christian@krikkel.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/input/hid.c')
-rw-r--r--hw/input/hid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/input/hid.c b/hw/input/hid.c
index 9656e90c59..148c003bb2 100644
--- a/hw/input/hid.c
+++ b/hw/input/hid.c
@@ -124,7 +124,7 @@ static void hid_pointer_event(DeviceState *dev, QemuConsole *src,
         if (evt->rel->axis == INPUT_AXIS_X) {
             e->xdx += evt->rel->value;
         } else if (evt->rel->axis == INPUT_AXIS_Y) {
-            e->ydy -= evt->rel->value;
+            e->ydy += evt->rel->value;
         }
         break;
 
@@ -191,7 +191,7 @@ static void hid_pointer_sync(DeviceState *dev)
         if (hs->kind == HID_MOUSE) {
             prev->xdx += curr->xdx;
             curr->xdx = 0;
-            prev->ydy -= curr->ydy;
+            prev->ydy += curr->ydy;
             curr->ydy = 0;
         } else {
             prev->xdx = curr->xdx;