Commit 4b968267 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Notify drivers of cursor changes on WM_WINE_SETCURSOR.

parent 3afff1a6
...@@ -77,6 +77,7 @@ static struct cursoricon_object *get_icon_ptr( HICON handle ) ...@@ -77,6 +77,7 @@ static struct cursoricon_object *get_icon_ptr( HICON handle )
BOOL process_wine_setcursor( HWND hwnd, HWND window, HCURSOR handle ) BOOL process_wine_setcursor( HWND hwnd, HWND window, HCURSOR handle )
{ {
TRACE( "hwnd %p, window %p, hcursor %p\n", hwnd, window, handle ); TRACE( "hwnd %p, window %p, hcursor %p\n", hwnd, window, handle );
user_driver->pSetCursor( window, handle );
return TRUE; return TRUE;
} }
...@@ -85,7 +86,6 @@ BOOL process_wine_setcursor( HWND hwnd, HWND window, HCURSOR handle ) ...@@ -85,7 +86,6 @@ BOOL process_wine_setcursor( HWND hwnd, HWND window, HCURSOR handle )
*/ */
INT WINAPI NtUserShowCursor( BOOL show ) INT WINAPI NtUserShowCursor( BOOL show )
{ {
HCURSOR cursor;
int increment = show ? 1 : -1; int increment = show ? 1 : -1;
int count; int count;
...@@ -94,16 +94,11 @@ INT WINAPI NtUserShowCursor( BOOL show ) ...@@ -94,16 +94,11 @@ INT WINAPI NtUserShowCursor( BOOL show )
req->flags = SET_CURSOR_COUNT; req->flags = SET_CURSOR_COUNT;
req->show_count = increment; req->show_count = increment;
wine_server_call( req ); wine_server_call( req );
cursor = wine_server_ptr_handle( reply->prev_handle );
count = reply->prev_count + increment; count = reply->prev_count + increment;
} }
SERVER_END_REQ; SERVER_END_REQ;
TRACE("%d, count=%d\n", show, count ); TRACE("%d, count=%d\n", show, count );
if (show && !count) user_driver->pSetCursor( 0, cursor );
else if (!show && count == -1) user_driver->pSetCursor( 0, 0 );
return count; return count;
} }
...@@ -114,7 +109,6 @@ HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor ) ...@@ -114,7 +109,6 @@ HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor )
{ {
struct cursoricon_object *obj; struct cursoricon_object *obj;
HCURSOR old_cursor; HCURSOR old_cursor;
int show_count;
BOOL ret; BOOL ret;
TRACE( "%p\n", cursor ); TRACE( "%p\n", cursor );
...@@ -124,16 +118,11 @@ HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor ) ...@@ -124,16 +118,11 @@ HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor )
req->flags = SET_CURSOR_HANDLE; req->flags = SET_CURSOR_HANDLE;
req->handle = wine_server_user_handle( cursor ); req->handle = wine_server_user_handle( cursor );
if ((ret = !wine_server_call_err( req ))) if ((ret = !wine_server_call_err( req )))
{
old_cursor = wine_server_ptr_handle( reply->prev_handle ); old_cursor = wine_server_ptr_handle( reply->prev_handle );
show_count = reply->prev_count;
}
} }
SERVER_END_REQ; SERVER_END_REQ;
if (!ret) return 0; if (!ret) return 0;
user_driver->pSetCursor( 0, show_count >= 0 ? cursor : 0 );
if (!(obj = get_icon_ptr( old_cursor ))) return 0; if (!(obj = get_icon_ptr( old_cursor ))) return 0;
release_user_handle_ptr( obj ); release_user_handle_ptr( obj );
return old_cursor; return old_cursor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment