diff options
author | dgp <dgp@users.sourceforge.net> | 2019-10-21 13:03:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-10-21 13:03:42 (GMT) |
commit | ef56eb393679cb51381bdd31558dabc011328e76 (patch) | |
tree | 6a11e245995e4c7e30a418e369108f841e394aac /win | |
parent | 4b84553a843a8019f456d5d8e7f5e1130576df68 (diff) | |
parent | e5ec9901434a09547d80a2fa1f351dedcf9e7f1b (diff) | |
download | tk-ef56eb393679cb51381bdd31558dabc011328e76.zip tk-ef56eb393679cb51381bdd31558dabc011328e76.tar.gz tk-ef56eb393679cb51381bdd31558dabc011328e76.tar.bz2 |
merge 8.6
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinPointer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 896500c..2b8656b 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -362,10 +362,12 @@ void TkSetCursorPos( int y) { INPUT input; + unsigned xscreen = (GetSystemMetrics(SM_CXSCREEN) - 1); + unsigned yscreen = (GetSystemMetrics(SM_CYSCREEN) - 1); input.type = INPUT_MOUSE; - input.mi.dx = x * (65535.0 / (GetSystemMetrics(SM_CXSCREEN) - 1)); - input.mi.dy = y * (65535.0 / (GetSystemMetrics(SM_CYSCREEN) - 1)); + input.mi.dx = (x * 65535 + xscreen/2) / xscreen; + input.mi.dy = (y * 65535 + yscreen/2) / yscreen; input.mi.mouseData = 0; input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; input.mi.time = 0; |