Module: wine Branch: master Commit: eeda373f6ff1989b61a256dfb66d6381930b2cb8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=eeda373f6ff1989b61a256dfb6... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon May 10 11:53:37 2010 +0200 user32: Fix checking of show count in ShowCursor. --- dlls/user32/cursoricon.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 856d900..9d7788d 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1701,7 +1701,7 @@ INT WINAPI DECLSPEC_HOTPATCH ShowCursor( BOOL bShow ) { HCURSOR cursor; int increment = bShow ? 1 : -1; - int prev_count; + int count; SERVER_START_REQ( set_cursor ) { @@ -1709,15 +1709,16 @@ INT WINAPI DECLSPEC_HOTPATCH ShowCursor( BOOL bShow ) req->show_count = increment; wine_server_call( req ); cursor = wine_server_ptr_handle( reply->prev_handle ); - prev_count = reply->prev_count; + count = reply->prev_count + increment; } SERVER_END_REQ; - TRACE("%d, count=%d\n", bShow, prev_count + increment ); + TRACE("%d, count=%d\n", bShow, count ); - if (!prev_count) USER_Driver->pSetCursor( bShow ? cursor : 0 ); + if (bShow && !count) USER_Driver->pSetCursor( cursor ); + else if (!bShow && count == -1) USER_Driver->pSetCursor( 0 ); - return prev_count + increment; + return count; } /***********************************************************************