Module: wine Branch: master Commit: 79c2e55b5a6331d15788f65a929e9e002c2f8b05 URL: http://source.winehq.org/git/wine.git/?a=commit;h=79c2e55b5a6331d15788f65a92...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Apr 20 20:30:09 2011 +0200
user32: Only call the driver when the cursor position has really changed.
---
dlls/user32/input.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 9b22021..28377e7 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -301,6 +301,7 @@ BOOL WINAPI GetCursorInfo( PCURSORINFO pci ) BOOL WINAPI DECLSPEC_HOTPATCH SetCursorPos( INT x, INT y ) { BOOL ret; + INT prev_x, prev_y, new_x, new_y;
SERVER_START_REQ( set_cursor ) { @@ -309,12 +310,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetCursorPos( INT x, INT y ) req->y = y; if ((ret = !wine_server_call( req ))) { - x = reply->new_x; - y = reply->new_y; + prev_x = reply->prev_x; + prev_y = reply->prev_y; + new_x = reply->new_x; + new_y = reply->new_y; } } SERVER_END_REQ; - if (ret) USER_Driver->pSetCursorPos( x, y ); + if (ret && (prev_x != new_x || prev_y != new_y)) USER_Driver->pSetCursorPos( new_x, new_y ); return ret; }