]> git.proxmox.com Git - qemu.git/commitdiff
usb-hid: Fix 0/0 position for Windows in tablet mode
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 30 Jul 2011 05:18:41 +0000 (07:18 +0200)
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>
Sat, 30 Jul 2011 05:18:41 +0000 (07:18 +0200)
For unknown reasons, Windows drivers (tested with XP and Win7) ignore
usb-tablet events that move the pointer to 0/0. So always report 0/0 as
1/0.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/usb-hid.c

index b812da2a6a716d9d4a4b6a2af22cbeb3e940254f..9008320c863905e40e3ce312eb7b1e7c88217ade 100644 (file)
@@ -459,6 +459,11 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel,
     } else {
         e->xdx = x1;
         e->ydy = y1;
+        /* Windows drivers do not like the 0/0 position and ignore such
+         * events. */
+        if (!(x1 | y1)) {
+            x1 = 1;
+        }
     }
     e->dz += z1;
 }