[PATCH 3/3] winex11.drv: use global key state in GetAsyncKeyState

Rafał Miłecki zajec5 at gmail.com
Sun Sep 6 08:28:08 CDT 2009


winex11.drv: use global key state in GetAsyncKeyState

This finally makes a use of global_key_state_table in
X11DRV_GetAsyncKeyState function. Finally introduces realy Async that
fixes bug.

-- 
Rafał Miłecki
-------------- next part --------------
From 46c3e741bb398779a0bdbc700487139586cdda7a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
Date: Sun, 6 Sep 2009 15:20:49 +0200
Subject: [PATCH] winex11.drv: use global key state in GetAsyncKeyState
To: wine-patches <wine-patches at winehq.org>
Reply-To: wine-devel <wine-devel at winehq.org>

---
 dlls/winex11.drv/keyboard.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index f02ae5a..e7afbd9 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1945,13 +1945,33 @@ static BOOL match_x11_keyboard_layout(HKL hkl)
 SHORT CDECL X11DRV_GetAsyncKeyState(INT key)
 {
     SHORT retval;
+    BOOL ret;
+    BYTE state;
 
     /* Photoshop livelocks unless mouse events are included here */
     X11DRV_MsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_KEY | QS_MOUSE, 0 );
 
-    retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) |
-             ((key_state_table[key] & 0x80) ? 0x8000 : 0);
+    SERVER_START_REQ( get_global_key_state )
+    {
+        req->key = key;
+        ret = !wine_server_call_err( req );
+        state = reply->state;
+    }
+    SERVER_END_REQ;
+
+    retval = ((state & 0x40) ? 0x0001 : 0) |
+             ((state & 0x80) ? 0x8000 : 0);
+
     key_state_table[key] &= ~0x40;
+
+    SERVER_START_REQ( set_global_key_state )
+    {
+        req->key      = key;
+        req->state    = key_state_table[key];
+        wine_server_call( req );
+    }
+    SERVER_END_REQ;
+
     TRACE_(key)("(%x) -> %x\n", key, retval);
     return retval;
 }
-- 
1.6.0.2


More information about the wine-patches mailing list