As it is always set to GetCurrentThreadId().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/input.c | 1 - dlls/winex11.drv/keyboard.c | 1 - server/protocol.def | 3 +-- server/queue.c | 18 +++--------------- 4 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 46dff3a89d4..8992c463c48 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -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 ); } diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 517522727fe..35a801fc895 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -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 ); diff --git a/server/protocol.def b/server/protocol.def index c468c5b7151..617818f622d 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -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 diff --git a/server/queue.c b/server/queue.c index 13a3641cfb8..e1f4f208fc8 100644 --- a/server/queue.c +++ b/server/queue.c @@ -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 ); - } }