Rebase against c7431990d815e664cf22267142b76cc59f21d192.

This commit is contained in:
Alistair Leslie-Hughes
2023-06-13 09:20:03 +10:00
parent 8273be2218
commit 117d2b2107
11 changed files with 92 additions and 216 deletions

View File

@@ -1,4 +1,4 @@
From 76aacbedda940eb85cbb98ea7207adcedcd039d8 Mon Sep 17 00:00:00 2001
From 7d60bf3ed45a7ad0d08fa94f3f28c0ca499c8641 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 23 Jan 2020 11:00:19 +0100
Subject: [PATCH] winex11.drv: Support XInput2 events for individual windows.
@@ -8,13 +8,13 @@ which can bring additional information.
---
dlls/winex11.drv/desktop.c | 2 ++
dlls/winex11.drv/event.c | 7 +++++
dlls/winex11.drv/mouse.c | 59 +++++++++++++++++++++++++++-----------
dlls/winex11.drv/mouse.c | 58 +++++++++++++++++++++++++++-----------
dlls/winex11.drv/window.c | 3 ++
dlls/winex11.drv/x11drv.h | 12 +++++++-
5 files changed, 66 insertions(+), 17 deletions(-)
5 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index 168029367d3..7a8fb70059e 100644
index 8a5682c1acb..6a5770c7671 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -379,6 +379,8 @@ BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height )
@@ -27,7 +27,7 @@ index 168029367d3..7a8fb70059e 100644
X11DRV_init_desktop( win, width, height );
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index b33fd6e0390..af96c10bbab 100644
index 2d46d516c69..d56634104e1 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -235,6 +235,13 @@ static Bool filter_event( Display *display, XEvent *event, char *arg )
@@ -45,7 +45,7 @@ index b33fd6e0390..af96c10bbab 100644
case MotionNotify:
case EnterNotify:
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index f9cf4a33255..edde25b7b43 100644
index 41cb1de8bbb..23b12a81215 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -305,20 +305,32 @@ void x11drv_xinput_init(void)
@@ -176,17 +176,16 @@ index f9cf4a33255..edde25b7b43 100644
NtUserDestroyWindow( msg_hwnd );
return FALSE;
}
@@ -533,7 +560,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd )
TRACE( "clip hwnd reset from %p\n", hwnd );
data->clip_hwnd = 0;
data->clip_reset = NtGetTickCount();
- disable_xinput2();
+ x11drv_xinput_disable( data->display, DefaultRootWindow( data->display ), PointerMotionMask );
NtUserDestroyWindow( hwnd );
}
else if (prev_clip_hwnd)
@@ -483,7 +510,6 @@ static void ungrab_clipping_window(void)
clipping_cursor = FALSE;
NtUserDestroyWindow( data->clip_hwnd );
data->clip_hwnd = 0;
- disable_xinput2();
}
/***********************************************************************
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 63827aa1aa6..39aff46c864 100644
index facf4f88e17..b3e42548f12 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -362,6 +362,7 @@ static void sync_window_style( struct x11drv_win_data *data )
@@ -214,7 +213,7 @@ index 63827aa1aa6..39aff46c864 100644
NtUserSetProp( hwnd, clip_window_prop, (HANDLE)data->clip_window );
X11DRV_DisplayDevices_RegisterEventHandlers();
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 5d176a9ef14..5666cd26434 100644
index 57dc9fdeb3c..c3f58f49b7d 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -264,6 +264,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
@@ -241,9 +240,9 @@ index 5d176a9ef14..5666cd26434 100644
struct x11drv_thread_data
{
Display *display;
@@ -395,7 +405,7 @@ struct x11drv_thread_data
@@ -394,7 +404,7 @@ struct x11drv_thread_data
Window clip_window; /* window used for cursor clipping */
HWND clip_hwnd; /* message window stored in desktop while clipping is active */
DWORD clip_reset; /* time when clipping was last reset */
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
- enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled } xi2_state; /* XInput2 state */
+ enum xi2_state xi2_state; /* XInput2 state */

View File

@@ -1,4 +1,4 @@
From c49e3afea43630cefb5c8ee9012b2ffd48a819e5 Mon Sep 17 00:00:00 2001
From 0df09be29ae67643b6a08986fa88bcee2026cd48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Sun, 24 Oct 2021 22:30:56 +0200
Subject: [PATCH] winex11.drv: Advertise XInput2 version 2.1 support.
@@ -22,10 +22,10 @@ device events only and get rid of slave device id tracking.
2 files changed, 5 insertions(+), 40 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index ea5e34059ec..b9ff9f38014 100644
index 608142a32e6..2d4453e320a 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -284,7 +284,7 @@ void x11drv_xinput_init(void)
@@ -285,7 +285,7 @@ void x11drv_xinput_init(void)
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct x11drv_thread_data *data = x11drv_thread_data();
@@ -34,7 +34,7 @@ index ea5e34059ec..b9ff9f38014 100644
if (data->xi2_state != xi_unknown) return;
@@ -297,7 +297,7 @@ void x11drv_xinput_init(void)
@@ -298,7 +298,7 @@ void x11drv_xinput_init(void)
else
{
data->xi2_state = xi_unavailable;
@@ -43,7 +43,7 @@ index ea5e34059ec..b9ff9f38014 100644
}
#endif
}
@@ -333,7 +333,7 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
@@ -334,7 +334,7 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
mask.mask = mask_bits;
mask.mask_len = sizeof(mask_bits);
@@ -52,7 +52,7 @@ index ea5e34059ec..b9ff9f38014 100644
memset( mask_bits, 0, sizeof(mask_bits) );
XISetMask( mask_bits, XI_DeviceChanged );
XISetMask( mask_bits, XI_RawMotion );
@@ -346,16 +346,6 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
@@ -347,16 +347,6 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
update_relative_valuators( pointer_info->classes, pointer_info->num_classes );
pXIFreeDeviceInfo( pointer_info );
@@ -69,7 +69,7 @@ index ea5e34059ec..b9ff9f38014 100644
data->xi2_state = xi_enabled;
}
@@ -388,19 +378,16 @@ void x11drv_xinput_disable( Display *display, Window window, long event_mask )
@@ -389,19 +379,16 @@ void x11drv_xinput_disable( Display *display, Window window, long event_mask )
mask.mask = NULL;
mask.mask_len = 0;
@@ -90,7 +90,7 @@ index ea5e34059ec..b9ff9f38014 100644
data->xi2_state = xi_disabled;
#endif
}
@@ -1860,7 +1847,6 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
@@ -1736,7 +1723,6 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
if (event->reason != XISlaveSwitch) return FALSE;
update_relative_valuators( event->classes, event->num_classes );
@@ -98,7 +98,7 @@ index ea5e34059ec..b9ff9f38014 100644
return TRUE;
}
@@ -1876,25 +1862,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -1752,25 +1738,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
if (x->number < 0 || y->number < 0) return FALSE;
if (!event->valuators.mask_len) return FALSE;
if (thread_data->xi2_state != xi_enabled) return FALSE;
@@ -126,11 +126,11 @@ index ea5e34059ec..b9ff9f38014 100644
virtual_rect = NtUserGetVirtualScreenRect();
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 344625aff71..3e4d49d3dcf 100644
index c3f58f49b7d..225b1534159 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -394,12 +394,9 @@ struct x11drv_thread_data
DWORD clip_reset; /* time when clipping was last reset */
@@ -405,12 +405,9 @@ struct x11drv_thread_data
HWND clip_hwnd; /* message window stored in desktop while clipping is active */
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
enum xi2_state xi2_state; /* XInput2 state */
- void *xi2_devices; /* list of XInput2 devices (valid when state is enabled) */
@@ -143,5 +143,5 @@ index 344625aff71..3e4d49d3dcf 100644
};
--
2.35.1
2.40.1

View File

@@ -1,4 +1,4 @@
From a09b36f783354e7cdd1e44fc57195b0136c8b2fd Mon Sep 17 00:00:00 2001
From 1bcdd8784df9149082a1686bb1a346a0d2f5bd28 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,7 +16,7 @@ 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 b1c47d5258e..c6a167dc4c6 100644
index 195cc65eddb..83169a9bb4d 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1811,13 +1811,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event )
@@ -51,7 +51,7 @@ index b1c47d5258e..c6a167dc4c6 100644
}
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 00c55802245..e25b3e7728a 100644
index 2d4453e320a..abf14ac55b4 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -30,6 +30,9 @@
@@ -150,7 +150,7 @@ index 00c55802245..e25b3e7728a 100644
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
/***********************************************************************
* update_relative_valuators
@@ -1876,6 +1951,8 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
@@ -1723,6 +1798,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 00c55802245..e25b3e7728a 100644
return TRUE;
}
@@ -1963,13 +2040,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1810,13 +1887,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */
@@ -174,7 +174,7 @@ index 00c55802245..e25b3e7728a 100644
int event, error;
void *libxi_handle = dlopen( SONAME_LIBXI, RTLD_NOW );
@@ -1985,11 +2061,20 @@ void x11drv_xinput_load(void)
@@ -1832,11 +1908,20 @@ void x11drv_xinput_load(void)
return; \
}
@@ -196,11 +196,11 @@ index 00c55802245..e25b3e7728a 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 7fcb9300ba0..38cacb4d3d4 100644
index 225b1534159..29c7259134a 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -702,6 +702,7 @@ extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN;
@@ -695,6 +695,7 @@ extern void sync_window_cursor( Window window ) DECLSPEC_HIDDEN;
extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
extern void move_resize_window( HWND hwnd, int dir ) DECLSPEC_HIDDEN;
extern void X11DRV_InitKeyboard( Display *display ) DECLSPEC_HIDDEN;
+extern void X11DRV_InitMouse( Display *display ) DECLSPEC_HIDDEN;
@@ -208,10 +208,10 @@ index 7fcb9300ba0..38cacb4d3d4 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 6457c0a0b93..e449530749e 100644
index 2691f40d750..fbff380c2b0 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -708,6 +708,7 @@ static NTSTATUS x11drv_init( void *arg )
@@ -705,6 +705,7 @@ static NTSTATUS x11drv_init( void *arg )
XkbUseExtension( gdi_display, NULL, NULL );
X11DRV_InitKeyboard( gdi_display );
@@ -220,5 +220,5 @@ index 6457c0a0b93..e449530749e 100644
init_user_driver();
--
2.40.0
2.40.1

View File

@@ -1,2 +1,3 @@
Fixes: [42631] Mouse drift, jump or don't react to small slow movements in Unity-engine games and Fallout 4 (partly fixed in Unity games, have walkaround in Fallout4 )
Fixes: [42675] Overwatch: Phantom mouse input / view pulled up to ceiling