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 272f712b605174e946da1dc65f927a23ee92a572.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 7d60bf3ed45a7ad0d08fa94f3f28c0ca499c8641 Mon Sep 17 00:00:00 2001
|
||||
From 2efe896d8b1b48a20a6f33691b0a2d12181124ca 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.
|
||||
@@ -27,7 +27,7 @@ index 8a5682c1acb..6a5770c7671 100644
|
||||
|
||||
X11DRV_init_desktop( win, width, height );
|
||||
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
|
||||
index 2d46d516c69..d56634104e1 100644
|
||||
index a7793f0c399..e5021eb38ff 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,10 +45,10 @@ index 2d46d516c69..d56634104e1 100644
|
||||
case MotionNotify:
|
||||
case EnterNotify:
|
||||
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
||||
index 41cb1de8bbb..23b12a81215 100644
|
||||
index 25077973f26..fbd463ce85d 100644
|
||||
--- a/dlls/winex11.drv/mouse.c
|
||||
+++ b/dlls/winex11.drv/mouse.c
|
||||
@@ -305,20 +305,32 @@ void x11drv_xinput_init(void)
|
||||
@@ -281,20 +281,32 @@ void x11drv_xinput_init(void)
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
@@ -86,7 +86,7 @@ index 41cb1de8bbb..23b12a81215 100644
|
||||
|
||||
mask.mask = mask_bits;
|
||||
mask.mask_len = sizeof(mask_bits);
|
||||
@@ -328,8 +340,9 @@ static void enable_xinput2(void)
|
||||
@@ -304,8 +316,9 @@ static void enable_xinput2(void)
|
||||
XISetMask( mask_bits, XI_RawMotion );
|
||||
XISetMask( mask_bits, XI_ButtonPress );
|
||||
|
||||
@@ -97,7 +97,7 @@ index 41cb1de8bbb..23b12a81215 100644
|
||||
pointer_info = pXIQueryDevice( data->display, data->xi2_core_pointer, &count );
|
||||
update_relative_valuators( pointer_info->classes, pointer_info->num_classes );
|
||||
pXIFreeDeviceInfo( pointer_info );
|
||||
@@ -338,7 +351,7 @@ static void enable_xinput2(void)
|
||||
@@ -314,7 +327,7 @@ static void enable_xinput2(void)
|
||||
* no XI_DeviceChanged events happened. If any hierarchy change occurred that
|
||||
* might be relevant here (eg. user switching mice after (un)plugging), a
|
||||
* XI_DeviceChanged event will point us to the right slave. So this list is
|
||||
@@ -106,7 +106,7 @@ index 41cb1de8bbb..23b12a81215 100644
|
||||
*/
|
||||
if (data->xi2_devices) pXIFreeDeviceInfo( data->xi2_devices );
|
||||
data->xi2_devices = pXIQueryDevice( data->display, XIAllDevices, &data->xi2_device_count );
|
||||
@@ -350,24 +363,37 @@ static void enable_xinput2(void)
|
||||
@@ -326,24 +339,37 @@ static void enable_xinput2(void)
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
@@ -150,7 +150,7 @@ index 41cb1de8bbb..23b12a81215 100644
|
||||
pXIFreeDeviceInfo( data->xi2_devices );
|
||||
data->x_valuator.number = -1;
|
||||
data->y_valuator.number = -1;
|
||||
@@ -376,6 +402,7 @@ static void disable_xinput2(void)
|
||||
@@ -352,6 +378,7 @@ static void disable_xinput2(void)
|
||||
data->xi2_devices = NULL;
|
||||
data->xi2_core_pointer = 0;
|
||||
data->xi2_current_slave = 0;
|
||||
@@ -158,34 +158,34 @@ index 41cb1de8bbb..23b12a81215 100644
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -420,7 +447,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
@@ -384,7 +411,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
}
|
||||
|
||||
/* enable XInput2 unless we are already clipping */
|
||||
- if (!data->clip_hwnd) enable_xinput2();
|
||||
+ if (!data->clip_hwnd) x11drv_xinput_enable( data->display, DefaultRootWindow( data->display ), PointerMotionMask );
|
||||
- if (!data->clipping_cursor) enable_xinput2();
|
||||
+ if (!data->clipping_cursor) x11drv_xinput_enable( data->display, DefaultRootWindow( data->display ), PointerMotionMask );
|
||||
|
||||
if (data->xi2_state != xi_enabled)
|
||||
{
|
||||
@@ -450,7 +477,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
@@ -424,7 +451,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
|
||||
if (!clipping_cursor)
|
||||
{
|
||||
- disable_xinput2();
|
||||
+ x11drv_xinput_disable( data->display, DefaultRootWindow( data->display ), PointerMotionMask );
|
||||
NtUserDestroyWindow( msg_hwnd );
|
||||
return FALSE;
|
||||
}
|
||||
@@ -483,7 +510,6 @@ static void ungrab_clipping_window(void)
|
||||
clip_rect = *clip;
|
||||
@@ -453,7 +480,6 @@ void ungrab_clipping_window(void)
|
||||
if (clipping_cursor) XUngrabPointer( data->display, CurrentTime );
|
||||
clipping_cursor = FALSE;
|
||||
NtUserDestroyWindow( data->clip_hwnd );
|
||||
data->clip_hwnd = 0;
|
||||
data->clipping_cursor = FALSE;
|
||||
- disable_xinput2();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
|
||||
index facf4f88e17..b3e42548f12 100644
|
||||
index 177cdc0faa3..e915ef4fe8b 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 )
|
||||
@@ -204,7 +204,7 @@ index facf4f88e17..b3e42548f12 100644
|
||||
set_initial_wm_hints( data->display, data->whole_window );
|
||||
set_wm_hints( data );
|
||||
|
||||
@@ -1982,6 +1984,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd )
|
||||
@@ -1980,6 +1982,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd )
|
||||
data->clip_window = XCreateWindow( data->display, root_window, 0, 0, 1, 1, 0, 0,
|
||||
InputOnly, default_visual.visual,
|
||||
CWOverrideRedirect | CWEventMask, &attr );
|
||||
@@ -213,7 +213,7 @@ index facf4f88e17..b3e42548f12 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 57dc9fdeb3c..c3f58f49b7d 100644
|
||||
index 4343a23f4d0..d8f7fa1441b 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -264,6 +264,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
|
||||
@@ -242,7 +242,7 @@ index 57dc9fdeb3c..c3f58f49b7d 100644
|
||||
Display *display;
|
||||
@@ -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 */
|
||||
BOOL clipping_cursor; /* whether thread is currently clipping the cursor */
|
||||
#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 */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 0df09be29ae67643b6a08986fa88bcee2026cd48 Mon Sep 17 00:00:00 2001
|
||||
From d16f519ea4973bfbdb91819c9a63046375ef2a96 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 608142a32e6..2d4453e320a 100644
|
||||
index fbd463ce85d..83e19493333 100644
|
||||
--- a/dlls/winex11.drv/mouse.c
|
||||
+++ b/dlls/winex11.drv/mouse.c
|
||||
@@ -285,7 +285,7 @@ void x11drv_xinput_init(void)
|
||||
@@ -261,7 +261,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 608142a32e6..2d4453e320a 100644
|
||||
|
||||
if (data->xi2_state != xi_unknown) return;
|
||||
|
||||
@@ -298,7 +298,7 @@ void x11drv_xinput_init(void)
|
||||
@@ -274,7 +274,7 @@ void x11drv_xinput_init(void)
|
||||
else
|
||||
{
|
||||
data->xi2_state = xi_unavailable;
|
||||
@@ -43,7 +43,7 @@ index 608142a32e6..2d4453e320a 100644
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -334,7 +334,7 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
|
||||
@@ -310,7 +310,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 608142a32e6..2d4453e320a 100644
|
||||
memset( mask_bits, 0, sizeof(mask_bits) );
|
||||
XISetMask( mask_bits, XI_DeviceChanged );
|
||||
XISetMask( mask_bits, XI_RawMotion );
|
||||
@@ -347,16 +347,6 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
|
||||
@@ -323,16 +323,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 608142a32e6..2d4453e320a 100644
|
||||
data->xi2_state = xi_enabled;
|
||||
}
|
||||
|
||||
@@ -389,19 +379,16 @@ void x11drv_xinput_disable( Display *display, Window window, long event_mask )
|
||||
@@ -365,19 +355,16 @@ void x11drv_xinput_disable( Display *display, Window window, long event_mask )
|
||||
|
||||
mask.mask = NULL;
|
||||
mask.mask_len = 0;
|
||||
@@ -90,7 +90,7 @@ index 608142a32e6..2d4453e320a 100644
|
||||
data->xi2_state = xi_disabled;
|
||||
#endif
|
||||
}
|
||||
@@ -1736,7 +1723,6 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
|
||||
@@ -1688,7 +1675,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 608142a32e6..2d4453e320a 100644
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1752,25 +1738,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
||||
@@ -1704,25 +1690,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 608142a32e6..2d4453e320a 100644
|
||||
virtual_rect = NtUserGetVirtualScreenRect();
|
||||
|
||||
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
|
||||
index c3f58f49b7d..225b1534159 100644
|
||||
index d8f7fa1441b..8b401080bc5 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -405,12 +405,9 @@ struct x11drv_thread_data
|
||||
HWND clip_hwnd; /* message window stored in desktop while clipping is active */
|
||||
BOOL clipping_cursor; /* whether thread is currently clipping the cursor */
|
||||
#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) */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 14edfa85b447be28ec0f47396c6ef03348c89586 Mon Sep 17 00:00:00 2001
|
||||
From baca91ec583435db0ab89dbe12791fcb277d1154 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
|
||||
@@ -51,7 +51,7 @@ index 195cc65eddb..83169a9bb4d 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
||||
index 6e7cdb642ff..9158e75b20d 100644
|
||||
index 83e19493333..20d57aa76f3 100644
|
||||
--- a/dlls/winex11.drv/mouse.c
|
||||
+++ b/dlls/winex11.drv/mouse.c
|
||||
@@ -30,6 +30,9 @@
|
||||
@@ -64,7 +64,7 @@ index 6e7cdb642ff..9158e75b20d 100644
|
||||
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
|
||||
#include <X11/extensions/XInput2.h>
|
||||
#endif
|
||||
@@ -141,6 +144,14 @@ MAKE_FUNCPTR(XISelectEvents);
|
||||
@@ -138,6 +141,14 @@ MAKE_FUNCPTR(XISelectEvents);
|
||||
#undef MAKE_FUNCPTR
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ index 6e7cdb642ff..9158e75b20d 100644
|
||||
/***********************************************************************
|
||||
* X11DRV_Xcursor_Init
|
||||
*
|
||||
@@ -228,6 +239,70 @@ void set_window_cursor( Window window, HCURSOR handle )
|
||||
@@ -225,6 +236,70 @@ void set_window_cursor( Window window, HCURSOR handle )
|
||||
XFlush( gdi_display );
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ index 6e7cdb642ff..9158e75b20d 100644
|
||||
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
|
||||
/***********************************************************************
|
||||
* update_relative_valuators
|
||||
@@ -1699,6 +1774,8 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
|
||||
@@ -1675,6 +1750,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 6e7cdb642ff..9158e75b20d 100644
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1786,13 +1863,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
@@ -1762,13 +1839,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
|
||||
#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */
|
||||
|
||||
@@ -174,7 +174,7 @@ index 6e7cdb642ff..9158e75b20d 100644
|
||||
int event, error;
|
||||
void *libxi_handle = dlopen( SONAME_LIBXI, RTLD_NOW );
|
||||
|
||||
@@ -1808,11 +1884,20 @@ void x11drv_xinput_load(void)
|
||||
@@ -1784,11 +1860,20 @@ void x11drv_xinput_load(void)
|
||||
return; \
|
||||
}
|
||||
|
||||
@@ -196,11 +196,11 @@ index 6e7cdb642ff..9158e75b20d 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 f84b1c20752..d3f74c63df0 100644
|
||||
index 8b401080bc5..d147add9d68 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -693,6 +693,7 @@ extern void set_window_cursor( Window window, HCURSOR handle ) DECLSPEC_HIDDEN;
|
||||
extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
|
||||
@@ -695,6 +695,7 @@ extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
|
||||
extern void ungrab_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;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 0ecc6d7db43e68d9d8d6a9ce2db7e664af8eecd7 Mon Sep 17 00:00:00 2001
|
||||
From 89e3ab4eceaa473697590e2264b0a1d7ccd149f4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Wed, 24 Mar 2021 23:29:28 +0100
|
||||
Subject: [PATCH] user32: Set SEND_HWMSG_RAWINPUT flags only when RAWINPUT is
|
||||
@@ -176,10 +176,10 @@ index 83169a9bb4d..ecd513ee2a4 100644
|
||||
|
||||
|
||||
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
||||
index 9158e75b20d..f745054ca64 100644
|
||||
index 20d57aa76f3..7925a2f4070 100644
|
||||
--- a/dlls/winex11.drv/mouse.c
|
||||
+++ b/dlls/winex11.drv/mouse.c
|
||||
@@ -647,6 +647,7 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
|
||||
@@ -626,6 +626,7 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
|
||||
static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
|
||||
{
|
||||
struct x11drv_win_data *data;
|
||||
@@ -187,16 +187,16 @@ index 9158e75b20d..f745054ca64 100644
|
||||
|
||||
input->type = INPUT_MOUSE;
|
||||
|
||||
@@ -657,7 +658,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
|
||||
if (!clip_hwnd) return;
|
||||
if (thread_data->clip_window != window) return;
|
||||
@@ -633,7 +634,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
{
|
||||
struct x11drv_thread_data *thread_data = x11drv_thread_data();
|
||||
if (!thread_data->clipping_cursor || thread_data->clip_window != window) return;
|
||||
- __wine_send_input( hwnd, input, NULL );
|
||||
+ __wine_send_input( hwnd, input, &rawinput );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -684,7 +685,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
@@ -660,7 +661,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ index 9158e75b20d..f745054ca64 100644
|
||||
}
|
||||
|
||||
#ifdef SONAME_LIBXCURSOR
|
||||
@@ -1612,6 +1613,7 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
@@ -1588,6 +1589,7 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
{
|
||||
MSG msg;
|
||||
INPUT input;
|
||||
@@ -213,7 +213,7 @@ index 9158e75b20d..f745054ca64 100644
|
||||
int x, y, rootX, rootY;
|
||||
|
||||
if (!XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &x, &y, &xstate )) break;
|
||||
@@ -1627,7 +1629,7 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
@@ -1603,7 +1605,7 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
|
||||
input.u.mi.time = NtGetTickCount();
|
||||
input.u.mi.dwExtraInfo = 0;
|
||||
@@ -222,7 +222,7 @@ index 9158e75b20d..f745054ca64 100644
|
||||
}
|
||||
|
||||
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
|
||||
@@ -1840,6 +1842,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
||||
@@ -1816,6 +1818,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
||||
static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
{
|
||||
XIRawEvent *event = xev->data;
|
||||
@@ -230,7 +230,7 @@ index 9158e75b20d..f745054ca64 100644
|
||||
INPUT input;
|
||||
|
||||
if (broken_rawevents && is_old_motion_event( xev->serial ))
|
||||
@@ -1857,7 +1860,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
@@ -1833,7 +1836,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
input.u.mi.dy = 0;
|
||||
if (!map_raw_event_coords( event, &input )) return FALSE;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 8a0662e0e65a8e9ebf0cf3e3123bc8cac071251d Mon Sep 17 00:00:00 2001
|
||||
From 8cfe8a261f9138c6227610fd0c9bc222bc0b1871 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Mon, 25 Oct 2021 11:45:47 +0200
|
||||
Subject: [PATCH] winex11.drv: Listen to RawMotion and RawButton* events in the
|
||||
@@ -9,13 +9,13 @@ to trigger low-level hooks callbacks when clipping cursor. This is for
|
||||
instance used in our dinput implementation.
|
||||
---
|
||||
dlls/winex11.drv/event.c | 10 +++-
|
||||
dlls/winex11.drv/mouse.c | 105 +++++++++++++++++++++++++++++++--
|
||||
dlls/winex11.drv/mouse.c | 106 ++++++++++++++++++++++++++++++---
|
||||
dlls/winex11.drv/x11drv.h | 1 +
|
||||
dlls/winex11.drv/x11drv_main.c | 4 ++
|
||||
4 files changed, 112 insertions(+), 8 deletions(-)
|
||||
4 files changed, 112 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
|
||||
index d56634104e1..6193717e82f 100644
|
||||
index e5021eb38ff..9cf7969dce2 100644
|
||||
--- a/dlls/winex11.drv/event.c
|
||||
+++ b/dlls/winex11.drv/event.c
|
||||
@@ -318,6 +318,10 @@ static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawE
|
||||
@@ -54,10 +54,10 @@ index d56634104e1..6193717e82f 100644
|
||||
#endif
|
||||
}
|
||||
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
||||
index f745054ca64..81c474d6605 100644
|
||||
index 7925a2f4070..fce58d2b48a 100644
|
||||
--- a/dlls/winex11.drv/mouse.c
|
||||
+++ b/dlls/winex11.drv/mouse.c
|
||||
@@ -392,7 +392,18 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
|
||||
@@ -389,7 +389,18 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
|
||||
memset( mask_bits, 0, sizeof(mask_bits) );
|
||||
XISetMask( mask_bits, XI_DeviceChanged );
|
||||
XISetMask( mask_bits, XI_RawMotion );
|
||||
@@ -77,16 +77,24 @@ index f745054ca64..81c474d6605 100644
|
||||
|
||||
pXISelectEvents( display, DefaultRootWindow( display ), &mask, 1 );
|
||||
|
||||
@@ -658,7 +669,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
@@ -626,7 +637,6 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
|
||||
static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
|
||||
{
|
||||
struct x11drv_win_data *data;
|
||||
- RAWINPUT rawinput;
|
||||
|
||||
if (!clip_hwnd) return;
|
||||
if (thread_data->clip_window != window) return;
|
||||
input->type = INPUT_MOUSE;
|
||||
|
||||
@@ -634,7 +644,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
{
|
||||
struct x11drv_thread_data *thread_data = x11drv_thread_data();
|
||||
if (!thread_data->clipping_cursor || thread_data->clip_window != window) return;
|
||||
- __wine_send_input( hwnd, input, &rawinput );
|
||||
+ __wine_send_input( hwnd, input, NULL );
|
||||
+ __wine_send_input( hwnd, input, NULL );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -685,7 +696,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
@@ -661,7 +671,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
|
||||
@@ -95,7 +103,7 @@ index f745054ca64..81c474d6605 100644
|
||||
}
|
||||
|
||||
#ifdef SONAME_LIBXCURSOR
|
||||
@@ -1613,7 +1624,6 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
@@ -1589,7 +1599,6 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
{
|
||||
MSG msg;
|
||||
INPUT input;
|
||||
@@ -103,7 +111,7 @@ index f745054ca64..81c474d6605 100644
|
||||
int x, y, rootX, rootY;
|
||||
|
||||
if (!XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &x, &y, &xstate )) break;
|
||||
@@ -1629,7 +1639,7 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
@@ -1605,7 +1614,7 @@ void move_resize_window( HWND hwnd, int dir )
|
||||
input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
|
||||
input.u.mi.time = NtGetTickCount();
|
||||
input.u.mi.dwExtraInfo = 0;
|
||||
@@ -112,7 +120,7 @@ index f745054ca64..81c474d6605 100644
|
||||
}
|
||||
|
||||
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
|
||||
@@ -1841,6 +1851,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
||||
@@ -1817,6 +1826,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
||||
*/
|
||||
static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
{
|
||||
@@ -120,7 +128,7 @@ index f745054ca64..81c474d6605 100644
|
||||
XIRawEvent *event = xev->data;
|
||||
RAWINPUT rawinput;
|
||||
INPUT input;
|
||||
@@ -1860,7 +1871,85 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
@@ -1836,7 +1846,85 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
||||
input.u.mi.dy = 0;
|
||||
if (!map_raw_event_coords( event, &input )) return FALSE;
|
||||
|
||||
@@ -207,7 +215,7 @@ index f745054ca64..81c474d6605 100644
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1936,6 +2025,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
|
||||
@@ -1912,6 +2000,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
|
||||
case XI_RawMotion:
|
||||
ret = X11DRV_RawMotion( event );
|
||||
break;
|
||||
@@ -219,7 +227,7 @@ index f745054ca64..81c474d6605 100644
|
||||
default:
|
||||
TRACE( "Unhandled event %#x\n", event->evtype );
|
||||
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
|
||||
index d3f74c63df0..a072b01fc7e 100644
|
||||
index d147add9d68..30486210df5 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -408,6 +408,7 @@ struct x11drv_thread_data
|
||||
|
Reference in New Issue
Block a user