mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Updated user32-rawinput-mouse patchset
This commit is contained in:
parent
13a418812a
commit
a1e634bca9
@ -1,4 +1,4 @@
|
||||
From 2efe896d8b1b48a20a6f33691b0a2d12181124ca Mon Sep 17 00:00:00 2001
|
||||
From ca644302ca33da93c0ae13177def7d1f554a0946 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,16 +8,16 @@ which can bring additional information.
|
||||
---
|
||||
dlls/winex11.drv/desktop.c | 2 ++
|
||||
dlls/winex11.drv/event.c | 7 +++++
|
||||
dlls/winex11.drv/mouse.c | 58 +++++++++++++++++++++++++++-----------
|
||||
dlls/winex11.drv/mouse.c | 59 +++++++++++++++++++++++++++-----------
|
||||
dlls/winex11.drv/window.c | 3 ++
|
||||
dlls/winex11.drv/x11drv.h | 12 +++++++-
|
||||
5 files changed, 65 insertions(+), 17 deletions(-)
|
||||
5 files changed, 66 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
|
||||
index 8a5682c1acb..6a5770c7671 100644
|
||||
index 687c0cf5a4c..01bd6a1b74a 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 )
|
||||
@@ -86,6 +86,8 @@ BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height )
|
||||
0, 0, width, height, 0, default_visual.depth, InputOutput,
|
||||
default_visual.visual, CWEventMask | CWCursor | CWColormap, &win_attr );
|
||||
if (!win) return FALSE;
|
||||
@ -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 a7793f0c399..e5021eb38ff 100644
|
||||
index c3c8d9a4070..f6d9041ca65 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 a7793f0c399..e5021eb38ff 100644
|
||||
case MotionNotify:
|
||||
case EnterNotify:
|
||||
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
||||
index 25077973f26..fbd463ce85d 100644
|
||||
index 65493326e36..8520e5a30ac 100644
|
||||
--- a/dlls/winex11.drv/mouse.c
|
||||
+++ b/dlls/winex11.drv/mouse.c
|
||||
@@ -281,20 +281,32 @@ void x11drv_xinput_init(void)
|
||||
@@ -280,20 +280,32 @@ void x11drv_xinput_init(void)
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
@ -86,7 +86,7 @@ index 25077973f26..fbd463ce85d 100644
|
||||
|
||||
mask.mask = mask_bits;
|
||||
mask.mask_len = sizeof(mask_bits);
|
||||
@@ -304,8 +316,9 @@ static void enable_xinput2(void)
|
||||
@@ -303,8 +315,9 @@ static void enable_xinput2(void)
|
||||
XISetMask( mask_bits, XI_RawMotion );
|
||||
XISetMask( mask_bits, XI_ButtonPress );
|
||||
|
||||
@ -97,7 +97,7 @@ index 25077973f26..fbd463ce85d 100644
|
||||
pointer_info = pXIQueryDevice( data->display, data->xi2_core_pointer, &count );
|
||||
update_relative_valuators( pointer_info->classes, pointer_info->num_classes );
|
||||
pXIFreeDeviceInfo( pointer_info );
|
||||
@@ -314,7 +327,7 @@ static void enable_xinput2(void)
|
||||
@@ -313,7 +326,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 25077973f26..fbd463ce85d 100644
|
||||
*/
|
||||
if (data->xi2_devices) pXIFreeDeviceInfo( data->xi2_devices );
|
||||
data->xi2_devices = pXIQueryDevice( data->display, XIAllDevices, &data->xi2_device_count );
|
||||
@@ -326,24 +339,37 @@ static void enable_xinput2(void)
|
||||
@@ -325,24 +338,37 @@ static void enable_xinput2(void)
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
@ -150,7 +150,7 @@ index 25077973f26..fbd463ce85d 100644
|
||||
pXIFreeDeviceInfo( data->xi2_devices );
|
||||
data->x_valuator.number = -1;
|
||||
data->y_valuator.number = -1;
|
||||
@@ -352,6 +378,7 @@ static void disable_xinput2(void)
|
||||
@@ -351,6 +377,7 @@ static void disable_xinput2(void)
|
||||
data->xi2_devices = NULL;
|
||||
data->xi2_core_pointer = 0;
|
||||
data->xi2_current_slave = 0;
|
||||
@ -158,7 +158,7 @@ index 25077973f26..fbd463ce85d 100644
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -384,7 +411,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
@@ -383,7 +410,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
}
|
||||
|
||||
/* enable XInput2 unless we are already clipping */
|
||||
@ -167,7 +167,7 @@ index 25077973f26..fbd463ce85d 100644
|
||||
|
||||
if (data->xi2_state != xi_enabled)
|
||||
{
|
||||
@@ -424,7 +451,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
@@ -423,7 +450,7 @@ static BOOL grab_clipping_window( const RECT *clip )
|
||||
|
||||
if (!clipping_cursor)
|
||||
{
|
||||
@ -176,16 +176,17 @@ index 25077973f26..fbd463ce85d 100644
|
||||
return FALSE;
|
||||
}
|
||||
clip_rect = *clip;
|
||||
@@ -453,7 +480,6 @@ void ungrab_clipping_window(void)
|
||||
@@ -452,7 +479,7 @@ void ungrab_clipping_window(void)
|
||||
if (clipping_cursor) XUngrabPointer( data->display, CurrentTime );
|
||||
clipping_cursor = FALSE;
|
||||
data->clipping_cursor = FALSE;
|
||||
- disable_xinput2();
|
||||
+ x11drv_xinput_disable( data->display, DefaultRootWindow( data->display ), PointerMotionMask );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
|
||||
index 177cdc0faa3..e915ef4fe8b 100644
|
||||
index ed3728773af..f043e64047e 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 )
|
||||
@ -196,7 +197,7 @@ index 177cdc0faa3..e915ef4fe8b 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1647,6 +1648,7 @@ static void create_whole_window( struct x11drv_win_data *data )
|
||||
@@ -1665,6 +1666,7 @@ static void create_whole_window( struct x11drv_win_data *data )
|
||||
data->vis.visual, mask, &attr );
|
||||
if (!data->whole_window) goto done;
|
||||
|
||||
@ -204,7 +205,7 @@ index 177cdc0faa3..e915ef4fe8b 100644
|
||||
set_initial_wm_hints( data->display, data->whole_window );
|
||||
set_wm_hints( data );
|
||||
|
||||
@@ -1980,6 +1982,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd )
|
||||
@@ -2003,6 +2005,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,10 +214,10 @@ index 177cdc0faa3..e915ef4fe8b 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 4343a23f4d0..d8f7fa1441b 100644
|
||||
index 16fc2843880..e8cc85a15bd 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -264,6 +264,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
|
||||
@@ -263,6 +263,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
|
||||
extern void X11DRV_Xcursor_Init(void) DECLSPEC_HIDDEN;
|
||||
extern void x11drv_xinput_load(void) DECLSPEC_HIDDEN;
|
||||
extern void x11drv_xinput_init(void) DECLSPEC_HIDDEN;
|
||||
@ -225,7 +226,7 @@ index 4343a23f4d0..d8f7fa1441b 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,
|
||||
@@ -379,6 +381,14 @@ struct x11drv_escape_flush_gl_drawable
|
||||
@@ -377,6 +379,14 @@ struct x11drv_escape_flush_gl_drawable
|
||||
* X11 USER driver
|
||||
*/
|
||||
|
||||
@ -240,7 +241,7 @@ index 4343a23f4d0..d8f7fa1441b 100644
|
||||
struct x11drv_thread_data
|
||||
{
|
||||
Display *display;
|
||||
@@ -394,7 +404,7 @@ struct x11drv_thread_data
|
||||
@@ -391,7 +401,7 @@ struct x11drv_thread_data
|
||||
Window clip_window; /* window used for cursor clipping */
|
||||
BOOL clipping_cursor; /* whether thread is currently clipping the cursor */
|
||||
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
|
||||
|
Loading…
Reference in New Issue
Block a user