summaryrefslogtreecommitdiffstats
path: root/win/tkWinPointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinPointer.c')
-rw-r--r--win/tkWinPointer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index e7e041f..06cbe67 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -368,6 +368,19 @@ void TkSetCursorPos(
input.type = INPUT_MOUSE;
input.mi.dx = (x * 65535 + xscreen/2) / xscreen;
input.mi.dy = (y * 65535 + yscreen/2) / yscreen;
+
+ /*
+ * Horrible workaround here. There is a bug on Win 10: when warping to
+ * pixel (x = 0, y = 0) the SendInput() below just does not move the
+ * mouse pointer. However, as soon as dx or dy is non zero it moves as
+ * expected. Given the scaling factor of 65535 (see above),
+ * (dx = 1 , dy = 0) still means pixel (x = 0, y = 0).
+ * See ticket [69b48f427e].
+ */
+ if (input.mi.dx == 0 && input.mi.dy == 0) {
+ input.mi.dx = 1;
+ }
+
input.mi.mouseData = 0;
input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.mi.time = 0;