Commit 5a30e318 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Optionally return the global key state when queueing a hardware message.

parent 5379a75b
...@@ -2796,6 +2796,7 @@ struct send_hardware_message_reply ...@@ -2796,6 +2796,7 @@ struct send_hardware_message_reply
{ {
struct reply_header __header; struct reply_header __header;
int wait; int wait;
/* VARARG(keystate,bytes); */
char __pad_12[4]; char __pad_12[4];
}; };
#define SEND_HWMSG_INJECTED 0x01 #define SEND_HWMSG_INJECTED 0x01
...@@ -5639,6 +5640,6 @@ union generic_reply ...@@ -5639,6 +5640,6 @@ union generic_reply
struct set_suspend_context_reply set_suspend_context_reply; struct set_suspend_context_reply set_suspend_context_reply;
}; };
#define SERVER_PROTOCOL_VERSION 428 #define SERVER_PROTOCOL_VERSION 429
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
...@@ -2032,6 +2032,7 @@ enum message_type ...@@ -2032,6 +2032,7 @@ enum message_type
unsigned int flags; /* flags (see below) */ unsigned int flags; /* flags (see below) */
@REPLY @REPLY
int wait; /* do we need to wait for a reply? */ int wait; /* do we need to wait for a reply? */
VARARG(keystate,bytes); /* global state array for all the keys */
@END @END
#define SEND_HWMSG_INJECTED 0x01 #define SEND_HWMSG_INJECTED 0x01
......
...@@ -2189,13 +2189,20 @@ DECL_HANDLER(send_hardware_message) ...@@ -2189,13 +2189,20 @@ DECL_HANDLER(send_hardware_message)
struct thread *thread = NULL; struct thread *thread = NULL;
struct desktop *desktop; struct desktop *desktop;
struct msg_queue *sender = get_current_queue(); struct msg_queue *sender = get_current_queue();
data_size_t size = min( 256, get_reply_max_size() );
if (!(desktop = get_thread_desktop( current, 0 ))) return;
if (req->win) if (req->win)
{ {
if (!(thread = get_window_thread( req->win ))) return; if (!(thread = get_window_thread( req->win ))) return;
desktop = (struct desktop *)grab_object( thread->queue->input->desktop ); if (desktop != thread->queue->input->desktop)
{
/* don't allow queuing events to a different desktop */
release_object( desktop );
return;
}
} }
else if (!(desktop = get_thread_desktop( current, 0 ))) return;
switch (req->input.type) switch (req->input.type)
{ {
...@@ -2212,6 +2219,7 @@ DECL_HANDLER(send_hardware_message) ...@@ -2212,6 +2219,7 @@ DECL_HANDLER(send_hardware_message)
set_error( STATUS_INVALID_PARAMETER ); set_error( STATUS_INVALID_PARAMETER );
} }
if (thread) release_object( thread ); if (thread) release_object( thread );
set_reply_data( desktop->keystate, size );
release_object( desktop ); release_object( desktop );
} }
......
...@@ -2452,6 +2452,7 @@ static void dump_send_hardware_message_request( const struct send_hardware_messa ...@@ -2452,6 +2452,7 @@ static void dump_send_hardware_message_request( const struct send_hardware_messa
static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req ) static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req )
{ {
fprintf( stderr, " wait=%d", req->wait ); fprintf( stderr, " wait=%d", req->wait );
dump_varargs_bytes( ", keystate=", cur_size );
} }
static void dump_get_message_request( const struct get_message_request *req ) static void dump_get_message_request( const struct get_message_request *req )
......
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