qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mod


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode
Date: Fri, 24 Jun 2011 16:27:03 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

For unknown reasons, Windows drivers (tested with XP and Win7) ignore
usb-tablet events that move the pointer to 0/0. So always set bit 0 of
the coordinates.

Signed-off-by: Jan Kiszka <address@hidden>
---
 hw/usb-hid.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index d711b5c..2b9a451 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, 
int xyrel,
         e->xdx += x1;
         e->ydy += y1;
     } else {
-        e->xdx = x1;
-        e->ydy = y1;
+        /* Windows drivers do not like the 0/0 position and ignore such
+         * events. */
+        e->xdx = x1 | 1;
+        e->ydy = y1 | 1;
     }
     e->dz += z1;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]