You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 16901659588c14b8336e5b2d1a5ace985c72e1f8.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 3d65939dad82bdcac186866eaaa3123611090b05 Mon Sep 17 00:00:00 2001
|
||||
From 6ab9c9e56ba70acd86faf8cb2e30021a2f1586b2 Mon Sep 17 00:00:00 2001
|
||||
From: Ken Thomases <ken@codeweavers.com>
|
||||
Date: Tue, 11 Dec 2018 08:30:41 +1100
|
||||
Subject: [PATCH] winex11: Match keyboard in Unicode
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] winex11: Match keyboard in Unicode
|
||||
1 file changed, 97 insertions(+), 64 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
|
||||
index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
index 8b2a89236f8..37992f6e663 100644
|
||||
--- a/dlls/winex11.drv/keyboard.c
|
||||
+++ b/dlls/winex11.drv/keyboard.c
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -28,7 +28,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
|
||||
/* Keyboard translation tables */
|
||||
#define MAIN_LEN 49
|
||||
@@ -1409,6 +1410,36 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
|
||||
@@ -1410,6 +1411,36 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
/**********************************************************************
|
||||
* X11DRV_KEYBOARD_DetectLayout
|
||||
*
|
||||
@@ -1426,7 +1457,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
@@ -1427,7 +1458,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
const char (*lkey)[MAIN_LEN][4];
|
||||
unsigned max_seq = 0;
|
||||
int max_score = INT_MIN, ismatch = 0;
|
||||
@@ -74,7 +74,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
|
||||
syms = keysyms_per_keycode;
|
||||
if (syms > 4) {
|
||||
@@ -1439,35 +1470,25 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
@@ -1440,35 +1471,25 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
/* get data for keycode from X server */
|
||||
for (i = 0; i < syms; i++) {
|
||||
if (!(keysym = keycode_to_keysym (display, keyc, i))) continue;
|
||||
@@ -118,7 +118,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
for (keyc = min_keycode; keyc <= max_keycode; keyc++) {
|
||||
if (ckey[keyc][0]) {
|
||||
/* search for a match in layout table */
|
||||
@@ -1476,10 +1497,13 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
@@ -1477,10 +1498,13 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
/* the table, it's okay that the X server has "3#£", for example) */
|
||||
/* however, the score will be higher for longer matches */
|
||||
for (key = 0; key < MAIN_LEN; key++) {
|
||||
@@ -135,7 +135,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
ok = -1;
|
||||
}
|
||||
if (ok > 0) {
|
||||
@@ -1494,11 +1518,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
@@ -1495,11 +1519,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
||||
if (key > pkey) seq++;
|
||||
pkey = key;
|
||||
} else {
|
||||
@@ -148,7 +148,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
mismatch++;
|
||||
score -= syms;
|
||||
}
|
||||
@@ -1568,9 +1588,11 @@ void X11DRV_InitKeyboard( Display *display )
|
||||
@@ -1569,9 +1589,11 @@ void X11DRV_InitKeyboard( Display *display )
|
||||
XKeyEvent e2;
|
||||
WORD scan, vkey;
|
||||
int keyc, i, keyn, syms;
|
||||
@@ -161,7 +161,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
|
||||
/* Ranges of OEM, function key, and character virtual key codes.
|
||||
* Don't include those handled specially in X11DRV_ToUnicodeEx and
|
||||
@@ -1625,7 +1647,11 @@ void X11DRV_InitKeyboard( Display *display )
|
||||
@@ -1627,7 +1649,11 @@ void X11DRV_InitKeyboard( Display *display )
|
||||
/* Detect the keyboard layout */
|
||||
X11DRV_KEYBOARD_DetectLayout( display );
|
||||
lkey = main_key_tab[kbd_layout].key;
|
||||
@@ -173,7 +173,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
|
||||
/* Now build two conversion arrays :
|
||||
* keycode -> vkey + scancode + extended
|
||||
@@ -1666,26 +1692,14 @@ void X11DRV_InitKeyboard( Display *display )
|
||||
@@ -1668,26 +1694,14 @@ void X11DRV_InitKeyboard( Display *display )
|
||||
int maxlen=0,maxval=-1,ok;
|
||||
for (i=0; i<syms; i++) {
|
||||
keysym = keycode_to_keysym(display, keyc, i);
|
||||
@@ -205,7 +205,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
if (!ok) i--; /* we overshot */
|
||||
if (ok||(i>maxlen)) {
|
||||
maxlen=i; maxval=keyn;
|
||||
@@ -2237,7 +2251,7 @@ INT X11DRV_GetKeyNameText( LONG lParam, LPWSTR lpBuffer, INT nSize )
|
||||
@@ -2250,7 +2264,7 @@ INT X11DRV_GetKeyNameText( LONG lParam, LPWSTR lpBuffer, INT nSize )
|
||||
/***********************************************************************
|
||||
* X11DRV_KEYBOARD_MapDeadKeysym
|
||||
*/
|
||||
@@ -214,7 +214,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
{
|
||||
switch (keysym)
|
||||
{
|
||||
@@ -2247,65 +2261,84 @@ static char KEYBOARD_MapDeadKeysym(KeySym keysym)
|
||||
@@ -2260,65 +2274,84 @@ static char KEYBOARD_MapDeadKeysym(KeySym keysym)
|
||||
#endif
|
||||
case 0x1000FE7E : /* Xfree's XK_Dtilde */
|
||||
return '~'; /* '? */
|
||||
@@ -314,7 +314,7 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
*/
|
||||
}
|
||||
TRACE("no character for dead keysym 0x%08lx\n",keysym);
|
||||
@@ -2490,7 +2523,7 @@ INT X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
|
||||
@@ -2503,7 +2536,7 @@ INT X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
@@ -323,11 +323,11 @@ index 786b6f4e084..c4d3b4ed8ce 100644
|
||||
|
||||
#ifdef XK_EuroSign
|
||||
/* An ugly hack for EuroSign: X can't translate it to a character
|
||||
@@ -2514,7 +2547,7 @@ INT X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
|
||||
@@ -2527,7 +2560,7 @@ INT X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
|
||||
dead_char = KEYBOARD_MapDeadKeysym(keysym);
|
||||
if (dead_char)
|
||||
{
|
||||
- MultiByteToWideChar(CP_UNIXCP, 0, &dead_char, 1, bufW, bufW_size);
|
||||
- ntdll_umbstowcs( &dead_char, 1, bufW, bufW_size );
|
||||
+ bufW[0] = dead_char;
|
||||
ret = -1;
|
||||
goto found;
|
||||
|
||||
Reference in New Issue
Block a user