winex11.drv: Synchronize debug output between X11DRV_KeyEvent and X11DRV_ToUnicodeEx

Dmitry Timoshkov dmitry at codeweavers.com
Mon May 21 03:27:34 CDT 2007


Hello,

Changelog:
    winex11.drv: Synchronize debug output between X11DRV_KeyEvent and X11DRV_ToUnicodeEx.

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

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 8738425..747e467 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1373,7 +1373,7 @@ void X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
         ascii_chars = XLookupString(event, Str, sizeof(Str), &keysym, NULL);
     wine_tsx11_unlock();
 
-    TRACE_(key)("state = %X nbyte = %d, status 0x%x\n", event->state, ascii_chars, status);
+    TRACE_(key)("nbyte = %d, status 0x%x\n", ascii_chars, status);
 
     if (status == XBufferOverflow)
         ERR("Buffer Overflow need %i!\n",ascii_chars);
@@ -1396,7 +1396,6 @@ void X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
     /* Save also all possible modifier states. */
     AltGrMask = event->state & (0x6000 | Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
 
-    Str[ascii_chars] = '\0';
     if (TRACE_ON(key)){
 	const char *ksname;
 
@@ -1405,9 +1404,9 @@ void X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
         wine_tsx11_unlock();
 	if (!ksname)
 	  ksname = "No Name";
-	TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / 0x%02x / '%s'\n",
+	TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / %s\n",
                     (event->type == KeyPress) ? "KeyPress" : "KeyRelease",
-                    keysym, ksname, ascii_chars, Str[0] & 0xff, Str);
+                    keysym, ksname, ascii_chars, debugstr_an(Str, ascii_chars));
     }
 
     wine_tsx11_lock();
@@ -2391,7 +2390,7 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
     char lpChar[10];
     HWND focus;
     XIC xic;
-    Status status;
+    Status status = 0;
 
     if (scanCode & 0x8000)
     {
@@ -2492,6 +2491,24 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
         ret = XLookupString(&e, lpChar, sizeof(lpChar), &keysym, NULL);
     wine_tsx11_unlock();
 
+    TRACE_(key)("nbyte = %d, status 0x%x\n", ret, status);
+
+    if (status == XBufferOverflow)
+        ERR("Buffer Overflow need %d!\n", ret);
+
+    if (TRACE_ON(key))
+    {
+        const char *ksname;
+
+        wine_tsx11_lock();
+        ksname = XKeysymToString(keysym);
+        wine_tsx11_unlock();
+        if (!ksname) ksname = "No Name";
+        TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / %s\n",
+                    (e.type == KeyPress) ? "KeyPress" : "KeyRelease",
+                    keysym, ksname, ret, debugstr_an(lpChar, ret));
+    }
+
     if (ret == 0)
     {
 	char dead_char;
-- 
1.5.1.6






More information about the wine-patches mailing list