When current thread doesn't have a message queue. It's going to be removed later anyway.
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 --- server/queue.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/server/queue.c b/server/queue.c index e1f4f208fc8..b026c03e13d 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2981,16 +2981,9 @@ DECL_HANDLER(get_key_state) set_reply_data( desktop->keystate, size ); release_object( desktop ); } - else + else if (!current->queue) { unsigned char *keystate; - if (current->queue) - { - if (req->key >= 0) reply->state = current->queue->input->keystate[req->key & 0xff]; - set_reply_data( current->queue->input->keystate, size ); - return; - } - /* fallback to desktop keystate */ if (!(desktop = get_thread_desktop( current, 0 ))) return; if (req->key >= 0) reply->state = desktop->keystate[req->key & 0xff] & ~0x40; @@ -3001,6 +2994,12 @@ DECL_HANDLER(get_key_state) } release_object( desktop ); } + else + { + unsigned char *keystate = current->queue->input->keystate; + if (req->key >= 0) reply->state = keystate[req->key & 0xff]; + set_reply_data( keystate, size ); + } }