Rebase against 56db5b0bf1aa6df5edbedbec03e0a1db39d6639b.

This commit is contained in:
Alistair Leslie-Hughes 2023-03-01 10:05:20 +11:00
parent 7b0d44f887
commit dc43a031be
8 changed files with 106 additions and 119 deletions

View File

@ -1,30 +1,29 @@
From da59fcb896bc204ea0ea1d866eeddef0c9b962c4 Mon Sep 17 00:00:00 2001
From d09ac9a348309f956a2f3985a1b465b51b6e174c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 28 Mar 2015 08:18:10 +0100
Subject: [PATCH] dsound: Apply filters before sound is multiplied to speakers.
Based on a patch by Mark Harmstone.
---
dlls/dsound/dsound.c | 2 +
dlls/dsound/dsound.c | 1 +
dlls/dsound/dsound_private.h | 4 +-
dlls/dsound/mixer.c | 109 ++++++++++++++++++++++++-----------
3 files changed, 80 insertions(+), 35 deletions(-)
dlls/dsound/mixer.c | 112 ++++++++++++++++++++++++-----------
3 files changed, 81 insertions(+), 36 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 346cc4ceca3..e869c4dd251 100644
index 0b8edaaaf06..bdf3a824511 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -234,6 +234,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
if(device->mmdevice)
IMMDevice_Release(device->mmdevice);
CloseHandle(device->sleepev);
+
+ HeapFree(GetProcessHeap(), 0, device->dsp_buffer);
HeapFree(GetProcessHeap(), 0, device->tmp_buffer);
HeapFree(GetProcessHeap(), 0, device->cp_buffer);
HeapFree(GetProcessHeap(), 0, device->buffer);
+ free(device->dsp_buffer);
free(device->tmp_buffer);
free(device->cp_buffer);
free(device->buffer);
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index f89588de4d9..d4e74ed0e82 100644
index 124a4311b4c..fe39ca221fa 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -89,8 +89,8 @@ struct DirectSoundDevice
@ -39,7 +38,7 @@ index f89588de4d9..d4e74ed0e82 100644
DSVOLUMEPAN volpan;
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index 50816b1a582..ddab45893ac 100644
index c26b19ea8c1..68a45c46d1e 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -283,10 +283,9 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb,
@ -150,7 +149,7 @@ index 50816b1a582..ddab45893ac 100644
/**
* Mix at most the given amount of data into the allocated temporary buffer
* of the given secondary buffer, starting from the dsb's first currently
@@ -497,34 +511,63 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
@@ -497,31 +511,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
*/
static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames)
{
@ -165,21 +164,20 @@ index 50816b1a582..ddab45893ac 100644
- if (dsb->device->tmp_buffer_len < size_bytes || !dsb->device->tmp_buffer)
- {
- dsb->device->tmp_buffer_len = size_bytes;
- dsb->device->tmp_buffer = realloc(dsb->device->tmp_buffer, size_bytes);
- }
- if(dsb->put_aux == putieee32_sum)
- memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
+ put = dsb->put;
+ ostride = dsb->device->pwfx->nChannels * sizeof(float);
+ size_bytes = frames * ostride;
+
+ if (dsb->device->tmp_buffer_len < size_bytes || !dsb->device->tmp_buffer) {
if (dsb->device->tmp_buffer)
dsb->device->tmp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->tmp_buffer, size_bytes);
else
dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, size_bytes);
+ dsb->device->tmp_buffer_len = size_bytes;
}
- if(dsb->put_aux == putieee32_sum)
- memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
-
- cp_fields(dsb, frames, &dsb->freqAccNum);
+ if (dsb->device->tmp_buffer_len < size_bytes || !dsb->device->tmp_buffer)
+ {
+ dsb->device->tmp_buffer_len = size_bytes;
+ dsb->device->tmp_buffer = realloc(dsb->device->tmp_buffer, size_bytes);
+ }
+ if(dsb->put_aux == putieee32_sum)
+ memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
+
@ -234,5 +232,5 @@ index 50816b1a582..ddab45893ac 100644
static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames)
--
2.35.1
2.39.2

View File

@ -1,4 +1,4 @@
From 5d29a2de174042ce7bdd52d92337591933e0f761 Mon Sep 17 00:00:00 2001
From 42c58e406220e9351337b079ae44364fbc39365d Mon Sep 17 00:00:00 2001
From: Mark Harmstone <mark@harmstone.com>
Date: Fri, 27 Mar 2015 20:58:37 +0000
Subject: [PATCH] dsound: Add EAX init and free stubs.
@ -10,10 +10,10 @@ Subject: [PATCH] dsound: Add EAX init and free stubs.
3 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
index e8b3fb4a832..28f2e95994e 100644
index 22b23c9f877..72e96765883 100644
--- a/dlls/dsound/buffer.c
+++ b/dlls/dsound/buffer.c
@@ -1153,6 +1153,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
@@ -1152,6 +1152,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
DSOUND_RecalcVolPan(&(dsb->volpan));
InitializeSRWLock(&dsb->lock);
@ -22,17 +22,17 @@ index e8b3fb4a832..28f2e95994e 100644
/* register buffer */
err = DirectSoundDevice_AddBuffer(device, dsb);
@@ -1194,6 +1196,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
HeapFree(GetProcessHeap(), 0, This->filters);
@@ -1193,6 +1195,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
free(This->filters);
}
+ free_eax_buffer(This);
+
TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(), 0, This);
free(This);
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 267b2c044bc..c906eb2adb1 100644
index 09566b28a12..703b5da8225 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -240,6 +240,8 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
@ -97,5 +97,5 @@ index 03b6e0a9813..91438efc335 100644
HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
--
2.35.1
2.39.2

View File

@ -1,4 +1,4 @@
From 3760db8daceee555842425400af01de2075b4568 Mon Sep 17 00:00:00 2001
From 673e9f32e39fce78a02f6519a435051ffec3664d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 4 Apr 2015 21:09:18 +0200
Subject: [PATCH] dsound: Various improvements to EAX support.
@ -24,19 +24,19 @@ the buffers).
5 files changed, 37 insertions(+), 39 deletions(-)
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
index 6b7414d34ff..b1efa0d3012 100644
index 72e96765883..bdb93657017 100644
--- a/dlls/dsound/buffer.c
+++ b/dlls/dsound/buffer.c
@@ -1213,7 +1213,7 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
@@ -1223,7 +1223,7 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
VOID *committedbuff;
TRACE("(%p,%p,%p)\n", device, ppdsb, pdsb);
- dsb = HeapAlloc(GetProcessHeap(),0,sizeof(*dsb));
+ dsb = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*dsb));
- dsb = malloc(sizeof(*dsb));
+ dsb = calloc(1, sizeof(*dsb));
if (dsb == NULL) {
WARN("out of memory\n");
*ppdsb = NULL;
@@ -1261,6 +1261,8 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
@@ -1271,6 +1271,8 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
InitializeSRWLock(&dsb->lock);
@ -46,7 +46,7 @@ index 6b7414d34ff..b1efa0d3012 100644
hres = DirectSoundDevice_AddBuffer(device, dsb);
if (hres != DS_OK) {
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 91fa94b943e..a0931325ebc 100644
index bdf3a824511..4df26e93c6e 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -182,6 +182,8 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice)
@ -71,10 +71,10 @@ index a650108f570..a555a75e458 100644
float *SampleBuffer;
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 43e62626161..065fe820055 100644
index 9131fa8792e..f2b2c353643 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -239,6 +239,7 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
@@ -240,6 +240,7 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
HRESULT WINAPI EAX_Set(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
ULONG dwPropID, void *pInstanceData, ULONG cbInstanceData, void *pPropData,
ULONG cbPropData) DECLSPEC_HIDDEN;
@ -83,7 +83,7 @@ index 43e62626161..065fe820055 100644
void init_eax_buffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN;
void process_eax_buffer(IDirectSoundBufferImpl *dsb, float *buf, DWORD count) DECLSPEC_HIDDEN;
diff --git a/dlls/dsound/eax.c b/dlls/dsound/eax.c
index a05b00e1c02..ef802b95a7d 100644
index 5f2b8ef07e2..2244565897b 100644
--- a/dlls/dsound/eax.c
+++ b/dlls/dsound/eax.c
@@ -114,6 +114,8 @@ static const float LATE_LINE_MULTIPLIER = 4.0f;
@ -244,5 +244,5 @@ index a05b00e1c02..ef802b95a7d 100644
switch (dwPropID) {
case DSPROPERTY_EAXBUFFER_ALL:
--
2.33.0
2.39.2

View File

@ -1,4 +1,4 @@
From 05d2f03034c4bd2cc97f22c67e7bd9de3c3f710b Mon Sep 17 00:00:00 2001
From 5cd6a66d34a8844d757413804a6b4b358075993d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 17 Jan 2020 16:33:11 +0100
Subject: [PATCH] winex11.drv: Split XInput2 thread initialization.
@ -11,10 +11,10 @@ And rename the library and function loader to x11drv_xinput_load.
3 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 51a6828f10c..121f42eb541 100644
index c34f5fde77e..f9cf4a33255 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -277,6 +277,32 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
@@ -278,6 +278,32 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
}
@ -47,7 +47,7 @@ index 51a6828f10c..121f42eb541 100644
/***********************************************************************
* enable_xinput2
*/
@@ -288,19 +314,9 @@ static void enable_xinput2(void)
@@ -289,19 +315,9 @@ static void enable_xinput2(void)
unsigned char mask_bits[XIMaskLen(XI_LASTEVENT)];
int count;
@ -69,7 +69,7 @@ index 51a6828f10c..121f42eb541 100644
if (!pXIGetClientPointer( data->display, None, &data->xi2_core_pointer )) return;
mask.mask = mask_bits;
@@ -341,9 +357,9 @@ static void disable_xinput2(void)
@@ -342,9 +358,9 @@ static void disable_xinput2(void)
struct x11drv_thread_data *data = x11drv_thread_data();
XIEventMask mask;
@ -80,7 +80,7 @@ index 51a6828f10c..121f42eb541 100644
data->xi2_state = xi_disabled;
mask.mask = NULL;
@@ -1921,9 +1937,9 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1954,9 +1970,9 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
/***********************************************************************
@ -93,10 +93,10 @@ index 51a6828f10c..121f42eb541 100644
#if defined(SONAME_LIBXI) && defined(HAVE_X11_EXTENSIONS_XINPUT2_H)
int event, error;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 8bcc204db9b..3f3e386ea4a 100644
index 10a68779003..a8bbc207007 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -247,7 +247,8 @@ extern void CDECL X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
@@ -258,7 +258,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
/* X11 driver internal functions */
extern void X11DRV_Xcursor_Init(void) DECLSPEC_HIDDEN;
@ -107,19 +107,19 @@ index 8bcc204db9b..3f3e386ea4a 100644
extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image,
const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits,
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 32beb84a009..2e083e322ec 100644
index 03a09a32d8a..657d8f52db0 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -619,7 +619,7 @@ static BOOL process_attach(void)
@@ -704,7 +704,7 @@ static NTSTATUS x11drv_init( void *arg )
#ifdef SONAME_LIBXCOMPOSITE
X11DRV_XComposite_Init();
#endif
- X11DRV_XInput2_Init();
+ x11drv_xinput_load();
#ifdef HAVE_XKB
if (use_xkb) use_xkb = XkbUseExtension( gdi_display, NULL, NULL );
@@ -713,6 +713,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
XkbUseExtension( gdi_display, NULL, NULL );
X11DRV_InitKeyboard( gdi_display );
@@ -794,6 +794,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
if (use_xim) X11DRV_SetupXIM();
@ -129,5 +129,5 @@ index 32beb84a009..2e083e322ec 100644
}
--
2.34.1
2.39.2

View File

@ -1,4 +1,4 @@
From 96b8ddff387307f13d34bd36a3e6363e6b50627f Mon Sep 17 00:00:00 2001
From 9f8722c6be41731d7913f804591a0c28999340cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 19 Dec 2019 22:34:44 +0100
Subject: [PATCH] winex11.drv: Keep track of pointer and device button
@ -16,10 +16,10 @@ Original patch by Andrew Eikum <aeikum@codeweavers.com>.
4 files changed, 106 insertions(+), 8 deletions(-)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index f1ad4b01669..5b1b892de32 100644
index 616728be621..5d02da68313 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1880,13 +1880,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event )
@@ -1863,13 +1863,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event )
{
HWND hwnd;
@ -51,7 +51,7 @@ index f1ad4b01669..5b1b892de32 100644
}
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 2b0aece8700..82a82032957 100644
index 00c55802245..e25b3e7728a 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -30,6 +30,9 @@
@ -150,7 +150,7 @@ index 2b0aece8700..82a82032957 100644
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
/***********************************************************************
* update_relative_valuators
@@ -1877,6 +1952,8 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
@@ -1876,6 +1951,8 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
if (event->reason != XISlaveSwitch) return FALSE;
update_relative_valuators( event->classes, event->num_classes );
@ -159,7 +159,7 @@ index 2b0aece8700..82a82032957 100644
return TRUE;
}
@@ -1964,13 +2041,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1963,13 +2040,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */
@ -174,7 +174,7 @@ index 2b0aece8700..82a82032957 100644
int event, error;
void *libxi_handle = dlopen( SONAME_LIBXI, RTLD_NOW );
@@ -1986,11 +2062,20 @@ void x11drv_xinput_load(void)
@@ -1985,11 +2061,20 @@ void x11drv_xinput_load(void)
return; \
}
@ -196,10 +196,10 @@ index 2b0aece8700..82a82032957 100644
xinput2_available = XQueryExtension( gdi_display, "XInputExtension", &xinput2_opcode, &event, &error );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index e342fc01cdf..16308dfab4e 100644
index 20172a99853..4394ea6d001 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -699,6 +699,7 @@ extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
@@ -702,6 +702,7 @@ extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN;
extern void move_resize_window( HWND hwnd, int dir ) DECLSPEC_HIDDEN;
extern void X11DRV_InitKeyboard( Display *display ) DECLSPEC_HIDDEN;
@ -208,17 +208,17 @@ index e342fc01cdf..16308dfab4e 100644
extern HWND *build_hwnd_list(void) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 891a514bbcc..0197ae93978 100644
index 657d8f52db0..142bd596dd3 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -712,6 +712,7 @@ static NTSTATUS x11drv_init( void *arg )
if (use_xkb) use_xkb = XkbUseExtension( gdi_display, NULL, NULL );
#endif
@@ -708,6 +708,7 @@ static NTSTATUS x11drv_init( void *arg )
XkbUseExtension( gdi_display, NULL, NULL );
X11DRV_InitKeyboard( gdi_display );
+ X11DRV_InitMouse( gdi_display );
if (use_xim) use_xim = X11DRV_InitXIM( input_style );
init_user_driver();
--
2.39.0
2.39.2

View File

@ -1,22 +1,16 @@
From 2caaacb0bd8f2feeba60d8a45959b83f6106a7a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
From 89800b44c37c6b76e1cdc817c3423638f4dd9ac8 Mon Sep 17 00:00:00 2001
From: Rémi Bernon <rbernon@codeweavers.com>
Date: Fri, 6 Jan 2023 08:09:11 +0100
Subject: [PATCH 3/9] winex11: Write supported keyboard layout list in
registry.
Subject: winex11: Write supported keyboard layout list in registry.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30984
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45605
---
dlls/winex11.drv/keyboard.c | 21 +++++++++++++++++++++
dlls/winex11.drv/x11drv.h | 4 ++++
dlls/winex11.drv/x11drv_main.c | 17 +++++++++++++++++
3 files changed, 42 insertions(+)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index f1ad4b01669..187979c4494 100644
index 616728be621..ccdea98d1c2 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1089,6 +1089,27 @@ static const WORD xfree86_vendor_key_vkey[256] =
@@ -1086,6 +1086,27 @@ static const WORD xfree86_vendor_key_vkey[256] =
0, 0, 0, 0, 0, 0, 0, 0 /* 1008FFF8 */
};
@ -41,14 +35,14 @@ index f1ad4b01669..187979c4494 100644
+ return layouts;
+}
+
static inline KeySym keycode_to_keysym( Display *display, KeyCode keycode, int index )
{
#ifdef HAVE_XKB
/* Returns the Windows virtual key code associated with the X event <e> */
/* kbd_section must be held */
static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e)
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index f4f6ba07e07..7d96ec648d1 100644
index c6328cf3fde..da8d9511a4c 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -709,6 +709,10 @@ extern BOOL xinerama_get_fullscreen_monitors( const RECT *rect, long *indices )
@@ -706,6 +706,10 @@ extern BOOL xinerama_get_fullscreen_monitors( const RECT *rect, long *indices )
extern void xinerama_init( unsigned int width, unsigned int height ) DECLSPEC_HIDDEN;
extern void init_recursive_mutex( pthread_mutex_t *mutex ) DECLSPEC_HIDDEN;
@ -60,10 +54,10 @@ index f4f6ba07e07..7d96ec648d1 100644
extern const unsigned int *depths DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index e04bdedd43a..66dbc3c8270 100644
index db957a80eb3..f3460141c33 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -449,6 +449,19 @@ static HKEY create_hkcu_key( const char *name )
@@ -446,6 +446,19 @@ static HKEY create_hkcu_key( const char *name )
return reg_open_hkcu_key( name, TRUE );
}
@ -83,7 +77,7 @@ index e04bdedd43a..66dbc3c8270 100644
ULONG query_reg_value( HKEY hkey, const WCHAR *name, KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size )
{
@@ -567,6 +580,10 @@ static void setup_options(void)
@@ -564,6 +577,10 @@ static void setup_options(void)
if (!get_config_key( hkey, appkey, "GrabFullscreen", buffer, sizeof(buffer) ))
grab_fullscreen = IS_OPTION_TRUE( buffer[0] );
@ -94,6 +88,3 @@ index e04bdedd43a..66dbc3c8270 100644
if (!get_config_key( hkey, appkey, "ScreenDepth", buffer, sizeof(buffer) ))
default_visual.depth = wcstol( buffer, NULL, 0 );
--
2.39.1

View File

@ -1,8 +1,7 @@
From 1e2f3aced42e5ad050a8bb6f173c3e4dcdae3b9b Mon Sep 17 00:00:00 2001
From 0f7681a0db7d45bbd3f76964bfc1d0cfe87cbbfc 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 8/9] winex11: Support fixed X11 keycode to scancode
conversion.
Subject: [PATCH] winex11: Support fixed X11 keycode to scancode conversion.
X11 keycodes are just Linux keycodes + 8 nowadays according to evdev or
libinput drivers, and we can avoid innacurate reconstruction in the most
@ -11,22 +10,19 @@ common case.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30984
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45605
---
dlls/winex11.drv/keyboard.c | 45 +++++++++++++++++++++++++++++++---
dlls/winex11.drv/keyboard.c | 44 ++++++++++++++++++++++++++++++++--
dlls/winex11.drv/x11drv.h | 1 +
dlls/winex11.drv/x11drv_main.c | 4 +++
3 files changed, 47 insertions(+), 3 deletions(-)
dlls/winex11.drv/x11drv_main.c | 4 ++++
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 5065d8048d1..c79c578af42 100644
index 2fa585d38b6..9a3890424a0 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -67,7 +67,46 @@ static const unsigned int ControlMask = 1 << 2;
@@ -66,6 +66,46 @@ static const unsigned int ControlMask = 1 << 2;
static int min_keycode, max_keycode, keysyms_per_keycode;
static KeySym *key_mapping;
-static WORD keyc2vkey[256], keyc2scan[256];
+static WORD keyc2vkey[256];
+
static WORD keyc2vkey[256], keyc2scan[256];
+/* default scancode mapping if keyboard_scancode_detect is FALSE,
+ * as most common X11 implementation use hardware scancode + 8.
+ */
@ -65,10 +61,12 @@ index 5065d8048d1..c79c578af42 100644
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+};
+
+
static int NumLockMask, ScrollLockMask, AltGrMask; /* mask in the XKeyEvent state */
@@ -1750,7 +1789,7 @@ void X11DRV_InitKeyboard( Display *display )
static pthread_mutex_t kbd_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -1742,7 +1782,7 @@ void X11DRV_InitKeyboard( Display *display )
}
TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey);
keyc2vkey[e2.keycode] = vkey;
@ -77,7 +75,7 @@ index 5065d8048d1..c79c578af42 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;
@@ -1861,7 +1900,7 @@ void X11DRV_InitKeyboard( Display *display )
@@ -1853,7 +1893,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,12 +83,12 @@ index 5065d8048d1..c79c578af42 100644
+ for (scan = 0x60, keyc = min_keycode; keyboard_scancode_detect && keyc <= max_keycode; keyc++)
if (keyc2vkey[keyc]&&!keyc2scan[keyc]) {
const char *ksname;
keysym = keycode_to_keysym(display, keyc, 0);
keysym = XkbKeycodeToKeysym( display, keyc, 0, 0 );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index c02a6c67111..3cf4c39d1d3 100644
index 653d2fe80e3..30a9403f185 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -444,6 +444,7 @@ extern BOOL show_systray DECLSPEC_HIDDEN;
@@ -456,6 +456,7 @@ extern BOOL show_systray DECLSPEC_HIDDEN;
extern BOOL grab_pointer DECLSPEC_HIDDEN;
extern BOOL grab_fullscreen DECLSPEC_HIDDEN;
extern int keyboard_layout DECLSPEC_HIDDEN;
@ -99,10 +97,10 @@ index c02a6c67111..3cf4c39d1d3 100644
extern BOOL managed_mode DECLSPEC_HIDDEN;
extern BOOL decorated_mode DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index dc2eb716d0b..bbdd5ad7010 100644
index 7056cf6643d..a9c0a150917 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -80,6 +80,7 @@ BOOL show_systray = TRUE;
@@ -77,6 +77,7 @@ BOOL show_systray = TRUE;
BOOL grab_pointer = TRUE;
BOOL grab_fullscreen = FALSE;
int keyboard_layout = -1;
@ -110,7 +108,7 @@ index dc2eb716d0b..bbdd5ad7010 100644
BOOL managed_mode = TRUE;
BOOL decorated_mode = TRUE;
BOOL private_color_map = FALSE;
@@ -588,6 +589,9 @@ static void setup_options(void)
@@ -586,6 +587,9 @@ static void setup_options(void)
if (p) set_reg_string_value( hkey, "KeyboardLayoutList", p, len * sizeof(WCHAR) );
free( p );
@ -121,5 +119,5 @@ index dc2eb716d0b..bbdd5ad7010 100644
default_visual.depth = wcstol( buffer, NULL, 0 );
--
2.39.1
2.39.2

View File

@ -1 +1 @@
3fb2a5d55e948670222170075f0054a2aabf8d7e
56db5b0bf1aa6df5edbedbec03e0a1db39d6639b