server: Split the fallback to desktop async keystate.

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>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-04-02 10:08:01 +02:00 committed by Alexandre Julliard
parent 6444e4fade
commit 2fcc1d0ecd
1 changed files with 7 additions and 8 deletions

View File

@ -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 );
}
}