Commit 6444e4fa authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard
parent 626870ab
......@@ -591,7 +591,6 @@ BOOL WINAPI SetKeyboardState( LPBYTE state )
SERVER_START_REQ( set_key_state )
{
req->tid = GetCurrentThreadId();
wine_server_add_data( req, state, 256 );
ret = !wine_server_call_err( req );
}
......
......@@ -1177,7 +1177,6 @@ static void set_async_key_state( const BYTE state[256] )
{
SERVER_START_REQ( set_key_state )
{
req->tid = GetCurrentThreadId();
req->async = 1;
wine_server_add_data( req, state, 256 );
wine_server_call( req );
......
......@@ -3846,10 +3846,8 @@ struct get_key_state_reply
struct set_key_state_request
{
struct request_header __header;
thread_id_t tid;
int async;
/* VARARG(keystate,bytes); */
char __pad_20[4];
};
struct set_key_state_reply
{
......@@ -6226,7 +6224,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 689
#define SERVER_PROTOCOL_VERSION 690
/* ### protocol_version end ### */
......
......@@ -2758,9 +2758,8 @@ enum coords_relative
VARARG(keystate,bytes); /* state array for all the keys */
@END
/* Set queue keyboard state for a given thread */
/* Set queue keyboard state for current thread */
@REQ(set_key_state)
thread_id_t tid; /* id of thread */
int async; /* whether to change the async state too */
VARARG(keystate,bytes); /* state array for all the keys */
@END
......
......@@ -3004,30 +3004,18 @@ DECL_HANDLER(get_key_state)
}
/* set queue keyboard state for a given thread */
/* set queue keyboard state for current thread */
DECL_HANDLER(set_key_state)
{
struct thread *thread;
struct desktop *desktop;
data_size_t size = min( 256, get_req_data_size() );
if (!req->tid) /* set global async key state */
if (current->queue) memcpy( current->queue->input->keystate, get_req_data(), size );
if (req->async && (desktop = get_thread_desktop( current, 0 )))
{
if (!(desktop = get_thread_desktop( current, 0 ))) return;
memcpy( desktop->keystate, get_req_data(), size );
release_object( desktop );
}
else
{
if (!(thread = get_thread_from_id( req->tid ))) return;
if (thread->queue) memcpy( thread->queue->input->keystate, get_req_data(), size );
if (req->async && (desktop = get_thread_desktop( thread, 0 )))
{
memcpy( desktop->keystate, get_req_data(), size );
release_object( desktop );
}
release_object( thread );
}
}
......
......@@ -1724,9 +1724,8 @@ C_ASSERT( FIELD_OFFSET(struct get_key_state_request, key) == 16 );
C_ASSERT( sizeof(struct get_key_state_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct get_key_state_reply, state) == 8 );
C_ASSERT( sizeof(struct get_key_state_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_key_state_request, tid) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_key_state_request, async) == 16 );
C_ASSERT( sizeof(struct set_key_state_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct set_key_state_request, async) == 12 );
C_ASSERT( sizeof(struct set_key_state_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_foreground_window_request, handle) == 12 );
C_ASSERT( sizeof(struct set_foreground_window_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_foreground_window_reply, previous) == 8 );
......
......@@ -3413,8 +3413,7 @@ static void dump_get_key_state_reply( const struct get_key_state_reply *req )
static void dump_set_key_state_request( const struct set_key_state_request *req )
{
fprintf( stderr, " tid=%04x", req->tid );
fprintf( stderr, ", async=%d", req->async );
fprintf( stderr, " async=%d", req->async );
dump_varargs_bytes( ", keystate=", cur_size );
}
......
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