Commit ac3646cc authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent 89faee01
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment