[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690

Alexandre Julliard julliard at winehq.org
Sun Jun 17 20:04:15 UTC 2012


The following commit has been merged in the wheezy branch:
commit 868646330fa0a22fed32b7630f55d5705e5c3e8c
Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jun 1 14:29:02 2012 +0200

    winex11: Use XGetKeyboardMapping instead of XKeycodeToKeysym.
    (cherry picked from commit c8a22a4d1f13c9b4f91084a2eed5b60083c82c58)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 3b91d8f..360c13e 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -61,6 +61,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(keyboard);
 WINE_DECLARE_DEBUG_CHANNEL(key);
 
 static int min_keycode, max_keycode, keysyms_per_keycode;
+static KeySym *key_mapping;
 static WORD keyc2vkey[256], keyc2scan[256];
 
 static int NumLockMask, ScrollLockMask, AltGrMask; /* mask in the XKeyEvent state */
@@ -1102,7 +1103,7 @@ static inline KeySym keycode_to_keysym( Display *display, KeyCode keycode, int i
 #ifdef HAVE_XKB
     if (use_xkb) return XkbKeycodeToKeysym(display, keycode, 0, index);
 #endif
-    return XKeycodeToKeysym(display, keycode, index);
+    return key_mapping[(keycode - min_keycode) * keysyms_per_keycode + index];
 }
 
 /* Returns the Windows virtual key code associated with the X event <e> */
@@ -1608,7 +1609,6 @@ static void set_kbd_layout_preload_key(void)
  */
 void X11DRV_InitKeyboard( Display *display )
 {
-    KeySym *ksp;
     XModifierKeymap *mmp;
     KeySym keysym;
     KeyCode *kcp;
@@ -1641,11 +1641,9 @@ void X11DRV_InitKeyboard( Display *display )
 
     wine_tsx11_lock();
     XDisplayKeycodes(display, &min_keycode, &max_keycode);
-    ksp = XGetKeyboardMapping(display, min_keycode,
-                              max_keycode + 1 - min_keycode, &keysyms_per_keycode);
-    /* We are only interested in keysyms_per_keycode.
-       There is no need to hold a local copy of the keysyms table */
-    XFree(ksp);
+    if (key_mapping) XFree( key_mapping );
+    key_mapping = XGetKeyboardMapping(display, min_keycode,
+                                      max_keycode + 1 - min_keycode, &keysyms_per_keycode);
 
     mmp = XGetModifierMapping(display);
     kcp = mmp->modifiermap;

-- 
Debian Wine packaging



More information about the pkg-wine-party mailing list