]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
input: fix jumpy mouse cursor with USB mouse emulation
authorChristian Burger <christian@krikkel.de>
Sat, 14 Jun 2014 19:19:41 +0000 (20:19 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 1 Jul 2014 11:26:37 +0000 (13:26 +0200)
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>
hw/input/hid.c

index 9656e90c59b8b7663bb8eccb54b4b7131ad2c98c..148c003bb29d91f940f024e099b64c8c8581b167 100644 (file)
@@ -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;