server: Return the cursor information for a thread input, and use it for GetCursorInfo.

This commit is contained in:
Alexandre Julliard 2010-05-11 11:21:03 +02:00
parent 7642e03c63
commit c545982472
6 changed files with 29 additions and 17 deletions

View File

@ -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;
}

View File

@ -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 */

View File

@ -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

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );
}