aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-07-30 07:18:41 +0200
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-07-30 07:18:41 +0200
commit8534b8ba337e55031592144ea524f7bcaf144113 (patch)
tree90ac74de37fdd6603846b93387ec58d4c64aa39c
parent3bf11207c0676cfd29a3c76c6709fdf9a983c0c8 (diff)
usb-hid: Fix 0/0 position for Windows in tablet mode
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>
-rw-r--r--hw/usb-hid.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index b812da2a6a..9008320c86 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -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;
}