server: Return the current cursor when queuing a hardware message.
This commit is contained in:
parent
3044d734b1
commit
cd28e2be7c
|
@ -2751,6 +2751,8 @@ struct send_hardware_message_request
|
|||
struct send_hardware_message_reply
|
||||
{
|
||||
struct reply_header __header;
|
||||
user_handle_t cursor;
|
||||
int count;
|
||||
};
|
||||
|
||||
|
||||
|
@ -5481,6 +5483,6 @@ union generic_reply
|
|||
struct set_cursor_reply set_cursor_reply;
|
||||
};
|
||||
|
||||
#define SERVER_PROTOCOL_VERSION 399
|
||||
#define SERVER_PROTOCOL_VERSION 400
|
||||
|
||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||
|
|
|
@ -1992,6 +1992,9 @@ enum message_type
|
|||
int x; /* x position */
|
||||
int y; /* y position */
|
||||
unsigned int time; /* message time */
|
||||
@REPLY
|
||||
user_handle_t cursor; /* current cursor for the target thread input */
|
||||
int count; /* current cursor count */
|
||||
@END
|
||||
|
||||
|
||||
|
|
|
@ -1262,12 +1262,11 @@ static user_handle_t find_hardware_message_window( struct thread_input *input, s
|
|||
}
|
||||
|
||||
/* queue a hardware message into a given thread input */
|
||||
static void queue_hardware_message( struct msg_queue *queue, struct message *msg,
|
||||
static void queue_hardware_message( struct thread_input *input, struct message *msg,
|
||||
struct hardware_msg_data *data )
|
||||
{
|
||||
user_handle_t win;
|
||||
struct thread *thread;
|
||||
struct thread_input *input = queue ? queue->input : foreground_input;
|
||||
unsigned int msg_code;
|
||||
|
||||
last_input_time = get_tick_count();
|
||||
|
@ -1704,20 +1703,20 @@ DECL_HANDLER(send_message)
|
|||
DECL_HANDLER(send_hardware_message)
|
||||
{
|
||||
struct message *msg;
|
||||
struct msg_queue *recv_queue = NULL;
|
||||
struct thread *thread = NULL;
|
||||
struct hardware_msg_data *data;
|
||||
struct thread_input *input = foreground_input;
|
||||
|
||||
if (req->id)
|
||||
{
|
||||
if (!(thread = get_thread_from_id( req->id ))) return;
|
||||
}
|
||||
|
||||
if (thread && !(recv_queue = thread->queue))
|
||||
{
|
||||
set_error( STATUS_INVALID_PARAMETER );
|
||||
release_object( thread );
|
||||
return;
|
||||
if (!thread->queue)
|
||||
{
|
||||
set_error( STATUS_INVALID_PARAMETER );
|
||||
release_object( thread );
|
||||
return;
|
||||
}
|
||||
input = thread->queue->input;
|
||||
}
|
||||
|
||||
if (!(data = mem_alloc( sizeof(*data) )))
|
||||
|
@ -1741,11 +1740,16 @@ DECL_HANDLER(send_hardware_message)
|
|||
msg->result = NULL;
|
||||
msg->data = data;
|
||||
msg->data_size = sizeof(*data);
|
||||
queue_hardware_message( recv_queue, msg, data );
|
||||
queue_hardware_message( input, msg, data );
|
||||
}
|
||||
else free( data );
|
||||
|
||||
if (thread) release_object( thread );
|
||||
if (thread)
|
||||
{
|
||||
reply->cursor = input->cursor;
|
||||
reply->count = input->cursor_count;
|
||||
release_object( thread );
|
||||
}
|
||||
}
|
||||
|
||||
/* post a quit message to the current queue */
|
||||
|
|
|
@ -1381,6 +1381,9 @@ C_ASSERT( FIELD_OFFSET(struct send_hardware_message_request, x) == 48 );
|
|||
C_ASSERT( FIELD_OFFSET(struct send_hardware_message_request, y) == 52 );
|
||||
C_ASSERT( FIELD_OFFSET(struct send_hardware_message_request, time) == 56 );
|
||||
C_ASSERT( sizeof(struct send_hardware_message_request) == 64 );
|
||||
C_ASSERT( FIELD_OFFSET(struct send_hardware_message_reply, cursor) == 8 );
|
||||
C_ASSERT( FIELD_OFFSET(struct send_hardware_message_reply, count) == 12 );
|
||||
C_ASSERT( sizeof(struct send_hardware_message_reply) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_message_request, flags) == 12 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_message_request, get_win) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_message_request, get_first) == 20 );
|
||||
|
|
|
@ -2427,6 +2427,12 @@ static void dump_send_hardware_message_request( const struct send_hardware_messa
|
|||
fprintf( stderr, ", time=%08x", req->time );
|
||||
}
|
||||
|
||||
static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req )
|
||||
{
|
||||
fprintf( stderr, " cursor=%08x", req->cursor );
|
||||
fprintf( stderr, ", count=%d", req->count );
|
||||
}
|
||||
|
||||
static void dump_get_message_request( const struct get_message_request *req )
|
||||
{
|
||||
fprintf( stderr, " flags=%08x", req->flags );
|
||||
|
@ -4190,7 +4196,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
|
|||
(dump_func)dump_get_process_idle_event_reply,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(dump_func)dump_send_hardware_message_reply,
|
||||
(dump_func)dump_get_message_reply,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in New Issue