Dmitry Timoshkov : winex11.drv: Clients should pass only KeyPress events to XmbLookupString.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 21 13:18:22 CST 2007


Module: wine
Branch: master
Commit: ac3646cc08dcb56cff8988b52987acea6c474d02
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ac3646cc08dcb56cff8988b52987acea6c474d02

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Feb 19 16:19:44 2007 +0800

winex11.drv: Clients should pass only KeyPress events to XmbLookupString.

---

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

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 33564cf..c025a38 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1124,7 +1124,8 @@ static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e)
     Status status;
     char buf[24];
 
-    if (xic)
+    /* Clients should pass only KeyPress events to XmbLookupString */
+    if (xic && e->type == KeyPress)
         XmbLookupString(xic, e, buf, sizeof(buf), &keysym, &status);
     else
         XLookupString(e, buf, sizeof(buf), &keysym, NULL);
@@ -1365,7 +1366,8 @@ void X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
 		event->type, event->window, event->state, event->keycode);
 
     wine_tsx11_lock();
-    if (xic)
+    /* Clients should pass only KeyPress events to XmbLookupString */
+    if (xic && event->type == KeyPress)
         ascii_chars = XmbLookupString(xic, event, Str, sizeof(Str), &keysym, &status);
     else
         ascii_chars = XLookupString(event, Str, sizeof(Str), &keysym, NULL);
@@ -2486,6 +2488,9 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
     TRACE_(key)("type %d, window %lx, state 0x%04x, keycode 0x%04x\n",
 		e.type, e.window, e.state, e.keycode);
 
+    /* Clients should pass only KeyPress events to XmbLookupString,
+     * e.type was set to KeyPress above.
+     */
     if (xic)
         ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, &status);
     else




More information about the wine-cvs mailing list