Rebase against 6a7bfbab10d653f6724e2917e0552515520e4fb3.

This commit is contained in:
Elizabeth Figura
2024-08-22 19:07:19 -05:00
parent ae46f56f2c
commit 5fad8dd101
10 changed files with 93 additions and 84 deletions

View File

@@ -1,4 +1,4 @@
From 4c7d3e59dc62e62aac5ce273494e1a7cb5349bd1 Mon Sep 17 00:00:00 2001
From 3e4287cf1f1824641954ce899abfcf68de7beaa7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 6 Jan 2023 08:09:11 +0100
Subject: [PATCH] winex11: Use the user configured keyboard layout if any.
@@ -12,10 +12,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45605
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 1846bd923a5..fe87ae2235d 100644
index 5b53a1b87b3..acd9def0f64 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -929,7 +929,6 @@ static const struct {
@@ -928,7 +928,6 @@ static const struct {
{0, NULL, NULL, NULL, NULL} /* sentinel */
};
@@ -23,7 +23,7 @@ index 1846bd923a5..fe87ae2235d 100644
/* maybe more of these scancodes should be extended? */
/* extended must be set for ALT_R, CTRL_R,
@@ -1084,6 +1083,26 @@ static const WORD xfree86_vendor_key_vkey[256] =
@@ -1083,6 +1082,26 @@ static const WORD xfree86_vendor_key_vkey[256] =
0, 0, 0, 0, 0, 0, 0, 0 /* 1008FFF8 */
};
@@ -50,7 +50,7 @@ index 1846bd923a5..fe87ae2235d 100644
WCHAR *x11drv_get_keyboard_layout_list( DWORD *length )
{
WCHAR *tmp, *layouts = calloc( 1, sizeof(WCHAR) );
@@ -1468,11 +1487,11 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
@@ -1449,11 +1468,11 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
* whichever matches most closely.
* kbd_section must be held.
*/
@@ -64,7 +64,7 @@ index 1846bd923a5..fe87ae2235d 100644
KeySym keysym = 0;
const char (*lkey)[MAIN_LEN][4];
unsigned max_seq = 0;
@@ -1570,6 +1589,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
@@ -1550,6 +1569,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
main_key_tab[kbd_layout].comment);
TRACE("detected layout is \"%s\"\n", main_key_tab[kbd_layout].comment);
@@ -72,7 +72,7 @@ index 1846bd923a5..fe87ae2235d 100644
}
@@ -1605,7 +1625,7 @@ void X11DRV_InitKeyboard( Display *display )
@@ -1585,7 +1605,7 @@ void X11DRV_InitKeyboard( Display *display )
{ 0x41, 0x5a }, /* VK_A - VK_Z */
{ 0, 0 }
};
@@ -81,7 +81,7 @@ index 1846bd923a5..fe87ae2235d 100644
pthread_mutex_lock( &kbd_mutex );
XDisplayKeycodes(display, &min_keycode, &max_keycode);
@@ -1637,8 +1657,9 @@ void X11DRV_InitKeyboard( Display *display )
@@ -1617,8 +1637,9 @@ void X11DRV_InitKeyboard( Display *display )
}
XFreeModifiermap(mmp);
@@ -94,18 +94,18 @@ index 1846bd923a5..fe87ae2235d 100644
syms = (keysyms_per_keycode > 4) ? 4 : keysyms_per_keycode;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 52260474ad2..f6baca922ef 100644
index 4f9ccd1e3f8..85012bf4bfc 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -447,6 +447,7 @@ extern BOOL use_take_focus;
@@ -429,6 +429,7 @@ extern BOOL use_take_focus;
extern BOOL use_primary_selection;
extern BOOL use_system_cursors;
extern BOOL grab_fullscreen;
+extern int keyboard_layout;
extern BOOL usexcomposite;
extern BOOL managed_mode;
extern BOOL decorated_mode;
@@ -707,6 +708,7 @@ extern void init_recursive_mutex( pthread_mutex_t *mutex );
extern BOOL private_color_map;
@@ -687,6 +688,7 @@ extern void init_recursive_mutex( pthread_mutex_t *mutex );
/* keyboard.c */
@@ -114,7 +114,7 @@ index 52260474ad2..f6baca922ef 100644
#define DEPTH_COUNT 3
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index b83365861d4..842f03be998 100644
index 56edca46f37..909de5e46eb 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -75,6 +75,7 @@ BOOL use_take_focus = TRUE;
@@ -123,9 +123,9 @@ index b83365861d4..842f03be998 100644
BOOL grab_fullscreen = FALSE;
+int keyboard_layout = -1;
BOOL managed_mode = TRUE;
BOOL decorated_mode = TRUE;
BOOL private_color_map = FALSE;
@@ -571,6 +572,9 @@ static void setup_options(void)
int primary_monitor = 0;
@@ -545,6 +546,9 @@ static void setup_options(void)
if (!get_config_key( hkey, appkey, "GrabFullscreen", buffer, sizeof(buffer) ))
grab_fullscreen = IS_OPTION_TRUE( buffer[0] );
@@ -136,5 +136,5 @@ index b83365861d4..842f03be998 100644
if (p) set_reg_string_value( hkey, "KeyboardLayoutList", p, len * sizeof(WCHAR) );
free( p );
--
2.42.0
2.45.2

View File

@@ -1,4 +1,4 @@
From c61fac8a28ccc3f6bfb1e502cfc1e4027fe2d2c9 Mon Sep 17 00:00:00 2001
From aea99c0314c0dd230b32d2936e8902bed6bd25b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 30 Nov 2022 18:46:00 +0100
Subject: [PATCH] winex11: Support fixed X11 keycode to scancode conversion.
@@ -16,7 +16,7 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45605
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index dbc1e1ea689..6a71da1a5d9 100644
index d06cef34035..74a0962434c 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -64,6 +64,46 @@ static const unsigned int ControlMask = 1 << 2;
@@ -66,7 +66,7 @@ index dbc1e1ea689..6a71da1a5d9 100644
static int NumLockMask, ScrollLockMask, AltGrMask; /* mask in the XKeyEvent state */
static pthread_mutex_t kbd_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -1737,7 +1777,7 @@ void X11DRV_InitKeyboard( Display *display )
@@ -1717,7 +1757,7 @@ void X11DRV_InitKeyboard( Display *display )
}
TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey);
keyc2vkey[e2.keycode] = vkey;
@@ -75,7 +75,7 @@ index dbc1e1ea689..6a71da1a5d9 100644
if ((vkey & 0xff) && vkey_used[(vkey & 0xff)])
WARN("vkey %04X is being used by more than one keycode\n", vkey);
vkey_used[(vkey & 0xff)] = 1;
@@ -1848,7 +1888,7 @@ void X11DRV_InitKeyboard( Display *display )
@@ -1828,7 +1868,7 @@ void X11DRV_InitKeyboard( Display *display )
#undef VKEY_IF_NOT_USED
/* If some keys still lack scancodes, assign some arbitrary ones to them now */
@@ -85,19 +85,19 @@ index dbc1e1ea689..6a71da1a5d9 100644
const char *ksname;
keysym = XkbKeycodeToKeysym( display, keyc, 0, 0 );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index f6baca922ef..e11c48dd3e2 100644
index 85012bf4bfc..7980980b9b8 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -448,6 +448,7 @@ extern BOOL use_primary_selection;
@@ -430,6 +430,7 @@ extern BOOL use_primary_selection;
extern BOOL use_system_cursors;
extern BOOL grab_fullscreen;
extern int keyboard_layout;
+extern BOOL keyboard_scancode_detect;
extern BOOL usexcomposite;
extern BOOL managed_mode;
extern BOOL decorated_mode;
extern BOOL private_color_map;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 842f03be998..782989dab4b 100644
index 909de5e46eb..3842aa4b3ea 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -76,6 +76,7 @@ BOOL use_primary_selection = FALSE;
@@ -106,9 +106,9 @@ index 842f03be998..782989dab4b 100644
int keyboard_layout = -1;
+BOOL keyboard_scancode_detect = TRUE;
BOOL managed_mode = TRUE;
BOOL decorated_mode = TRUE;
BOOL private_color_map = FALSE;
@@ -579,6 +580,9 @@ static void setup_options(void)
int primary_monitor = 0;
@@ -553,6 +554,9 @@ static void setup_options(void)
if (p) set_reg_string_value( hkey, "KeyboardLayoutList", p, len * sizeof(WCHAR) );
free( p );
@@ -119,5 +119,5 @@ index 842f03be998..782989dab4b 100644
default_visual.depth = wcstol( buffer, NULL, 0 );
--
2.42.0
2.45.2

View File

@@ -1,4 +1,4 @@
From cdb9c20dfeede2240d102ac2f407f58591b3ec2d Mon Sep 17 00:00:00 2001
From 609658c175d92bc3202744ed32ce6ee4de2bf648 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 6 Jan 2023 11:31:36 +0100
Subject: [PATCH] winex11: Disable keyboard scancode auto-detection by default.
@@ -11,7 +11,7 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45605
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 782989dab4b..3bee214e09b 100644
index 3842aa4b3ea..9bc12c2b5f5 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -76,7 +76,7 @@ BOOL use_primary_selection = FALSE;
@@ -21,8 +21,8 @@ index 782989dab4b..3bee214e09b 100644
-BOOL keyboard_scancode_detect = TRUE;
+BOOL keyboard_scancode_detect = FALSE;
BOOL managed_mode = TRUE;
BOOL decorated_mode = TRUE;
BOOL private_color_map = FALSE;
int primary_monitor = 0;
diff --git a/programs/winecfg/input.c b/programs/winecfg/input.c
index a9d83b45f00..3ee20d49874 100644
--- a/programs/winecfg/input.c
@@ -37,5 +37,5 @@ index a9d83b45f00..3ee20d49874 100644
else CheckDlgButton( dialog, IDC_KEYBOARD_SCANCODE_DETECT, BST_UNCHECKED );
free( buffer );
--
2.42.0
2.45.2