Module: wine Branch: master Commit: c5459824724660bcd0c0cdaabd096785dc4bb2ae URL: http://source.winehq.org/git/wine.git/?a=commit;h=c5459824724660bcd0c0cdaabd...
Author: Alexandre Julliard julliard@winehq.org Date: Tue May 11 11:21:03 2010 +0200
server: Return the cursor information for a thread input, and use it for GetCursorInfo.
---
dlls/user32/input.c | 17 ++++++++++++++--- include/wine/server_protocol.h | 6 ++++-- server/protocol.def | 2 ++ server/queue.c | 13 +++---------- server/request.h | 6 ++++-- server/trace.c | 2 ++ 6 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index f14590d..0dccf21 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -207,11 +207,22 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt ) */ BOOL WINAPI GetCursorInfo( PCURSORINFO pci ) { + BOOL ret; + if (!pci) return 0; - pci->hCursor = LoadCursorW( 0, (LPCWSTR)IDC_ARROW ); - pci->flags = CURSOR_SHOWING; + + SERVER_START_REQ( get_thread_input ) + { + req->tid = 0; + if ((ret = !wine_server_call( req ))) + { + pci->hCursor = wine_server_ptr_handle( reply->cursor ); + pci->flags = (reply->show_count >= 0) ? CURSOR_SHOWING : 0; + } + } + SERVER_END_REQ; GetCursorPos(&pci->ptScreenPos); - return 1; + return ret; }
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 24790a5..20bb4a2 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3697,8 +3697,10 @@ struct get_thread_input_reply user_handle_t menu_owner; user_handle_t move_size; user_handle_t caret; + user_handle_t cursor; + int show_count; rectangle_t rect; - char __pad_52[4]; + char __pad_60[4]; };
@@ -5483,6 +5485,6 @@ union generic_reply struct set_cursor_reply set_cursor_reply; };
-#define SERVER_PROTOCOL_VERSION 400 +#define SERVER_PROTOCOL_VERSION 401
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index 5015e97..e4e8ec3 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2604,6 +2604,8 @@ enum message_type user_handle_t menu_owner; /* handle to the menu owner */ user_handle_t move_size; /* handle to the moving/resizing window */ user_handle_t caret; /* handle to the caret window */ + user_handle_t cursor; /* handle to the cursor */ + int show_count; /* cursor show count */ rectangle_t rect; /* caret rectangle */ @END
diff --git a/server/queue.c b/server/queue.c index 4a06a73..d2090cd 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2055,18 +2055,11 @@ DECL_HANDLER(get_thread_input) reply->menu_owner = input->menu_owner; reply->move_size = input->move_size; reply->caret = input->caret; + reply->cursor = input->cursor; + reply->show_count = input->cursor_count; reply->rect = input->caret_rect; } - else - { - reply->focus = 0; - reply->capture = 0; - reply->active = 0; - reply->menu_owner = 0; - reply->move_size = 0; - reply->caret = 0; - reply->rect.left = reply->rect.top = reply->rect.right = reply->rect.bottom = 0; - } + /* foreground window is active window of foreground thread */ reply->foreground = foreground_input ? foreground_input->active : 0; if (thread) release_object( thread ); diff --git a/server/request.h b/server/request.h index 604d115..ef6adea 100644 --- a/server/request.h +++ b/server/request.h @@ -1712,8 +1712,10 @@ C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, foreground) == 20 ); C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, menu_owner) == 24 ); C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, move_size) == 28 ); C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, caret) == 32 ); -C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, rect) == 36 ); -C_ASSERT( sizeof(struct get_thread_input_reply) == 56 ); +C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, cursor) == 36 ); +C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, show_count) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_thread_input_reply, rect) == 44 ); +C_ASSERT( sizeof(struct get_thread_input_reply) == 64 ); C_ASSERT( sizeof(struct get_last_input_time_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_last_input_time_reply, time) == 8 ); C_ASSERT( sizeof(struct get_last_input_time_reply) == 16 ); diff --git a/server/trace.c b/server/trace.c index c97bd70..ec87dab 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3076,6 +3076,8 @@ static void dump_get_thread_input_reply( const struct get_thread_input_reply *re fprintf( stderr, ", menu_owner=%08x", req->menu_owner ); fprintf( stderr, ", move_size=%08x", req->move_size ); fprintf( stderr, ", caret=%08x", req->caret ); + fprintf( stderr, ", cursor=%08x", req->cursor ); + fprintf( stderr, ", show_count=%d", req->show_count ); dump_rectangle( ", rect=", &req->rect ); }