Rebase against e2aa30f21def839866b09e74b5ddd843f7e70c87.

This commit is contained in:
Alistair Leslie-Hughes
2021-05-06 08:14:30 +10:00
parent 1ebf4bd23f
commit 046b1ab22c
7 changed files with 104 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
From a5bff960bdb07ad110189c2ea7394370ac28b512 Mon Sep 17 00:00:00 2001
From 7158d919b04dc9229064370be73e3bc01fb3f782 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.
@@ -26,7 +26,7 @@ index b517e44e150..6f46ef505c9 100644
X11DRV_init_desktop( win, width, height );
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 99943478729..217c1eca857 100644
index 9de7ffa3f3c..14770d3364a 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -245,6 +245,13 @@ static Bool filter_event( Display *display, XEvent *event, char *arg )
@@ -185,7 +185,7 @@ index ce77c7e5985..2550af3cb9c 100644
}
else if (prev_clip_hwnd)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index baaa30d74e3..4005e3df387 100644
index cfac86c224d..b2c5f4016fe 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -375,6 +375,7 @@ static void sync_window_style( struct x11drv_win_data *data )
@@ -196,7 +196,7 @@ index baaa30d74e3..4005e3df387 100644
}
}
@@ -1573,6 +1574,7 @@ static void create_whole_window( struct x11drv_win_data *data )
@@ -1591,6 +1592,7 @@ static void create_whole_window( struct x11drv_win_data *data )
data->vis.visual, mask, &attr );
if (!data->whole_window) goto done;
@@ -204,7 +204,7 @@ index baaa30d74e3..4005e3df387 100644
set_initial_wm_hints( data->display, data->whole_window );
set_wm_hints( data );
@@ -1879,6 +1881,7 @@ BOOL CDECL X11DRV_CreateWindow( HWND hwnd )
@@ -1897,6 +1899,7 @@ BOOL CDECL 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 baaa30d74e3..4005e3df387 100644
SetPropA( hwnd, clip_window_prop, (HANDLE)data->clip_window );
X11DRV_InitClipboard();
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 16a8a6be2be..7ea60fa495a 100644
index 6f254368ab7..b014fd6ae11 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -197,6 +197,8 @@ extern BOOL CDECL X11DRV_UnrealizePalette( HPALETTE hpal ) DECLSPEC_HIDDEN;
@@ -225,7 +225,7 @@ index 16a8a6be2be..7ea60fa495a 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,
@@ -324,6 +326,14 @@ struct x11drv_valuator_data
@@ -325,6 +327,14 @@ struct x11drv_valuator_data
int number;
};
@@ -240,10 +240,10 @@ index 16a8a6be2be..7ea60fa495a 100644
struct x11drv_thread_data
{
Display *display;
@@ -339,7 +349,7 @@ struct x11drv_thread_data
@@ -340,7 +350,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 */
HKL kbd_layout; /* active keyboard layout */
- enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled } xi2_state; /* XInput2 state */
+ enum xi2_state xi2_state; /* XInput2 state */
void *xi2_devices; /* list of XInput2 devices (valid when state is enabled) */

View File

@@ -1,4 +1,4 @@
From 3addef6ede746e418be37c5f288027bb0247f37c Mon Sep 17 00:00:00 2001
From e71967fd27b8fb686311dfc1463fe32956d1d23f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 2 Aug 2019 02:24:32 -0400
Subject: [PATCH] winex11.drv: Advertise XInput2 version 2.1 support.
@@ -125,12 +125,12 @@ index 2550af3cb9c..0d41438c5c7 100644
x_rel = &thread_data->x_rel_valuator;
y_rel = &thread_data->y_rel_valuator;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 7ea60fa495a..df8a53bb228 100644
index b014fd6ae11..e7e75d4d072 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -350,12 +350,9 @@ struct x11drv_thread_data
@@ -351,12 +351,9 @@ struct x11drv_thread_data
HWND clip_hwnd; /* message window stored in desktop while clipping is active */
DWORD clip_reset; /* time when clipping was last reset */
HKL kbd_layout; /* active keyboard layout */
enum xi2_state xi2_state; /* XInput2 state */
- void *xi2_devices; /* list of XInput2 devices (valid when state is enabled) */
- int xi2_device_count;

View File

@@ -1,4 +1,4 @@
From a88aed6df65592b55fde5ecee55b090149c362bb Mon Sep 17 00:00:00 2001
From f75111bb0bcc4478dab7b00ddf66362bf29b0624 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 01620c5e4a4..272f728def9 100644
index ce10f6ee1a3..390b36e7695 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1976,13 +1976,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event )
@@ -1942,13 +1942,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event )
{
HWND hwnd;
@@ -35,7 +35,7 @@ index 01620c5e4a4..272f728def9 100644
+ hwnd = GetFocus();
+ if (!hwnd) hwnd = GetActiveWindow();
+ PostMessageW(hwnd, WM_INPUTLANGCHANGEREQUEST,
+ 0 /*FIXME*/, (LPARAM)X11DRV_GetKeyboardLayout(0));
+ 0 /*FIXME*/, (LPARAM)GetKeyboardLayout(0));
+ break;
+
+ case MappingPointer:
@@ -46,7 +46,7 @@ index 01620c5e4a4..272f728def9 100644
- hwnd = GetFocus();
- if (!hwnd) hwnd = GetActiveWindow();
- PostMessageW(hwnd, WM_INPUTLANGCHANGEREQUEST,
- 0 /*FIXME*/, (LPARAM)X11DRV_GetKeyboardLayout(0));
- 0 /*FIXME*/, (LPARAM)GetKeyboardLayout(0));
return TRUE;
}
@@ -196,10 +196,10 @@ index 0d41438c5c7..fc5fd29d7b6 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 df8a53bb228..afa990b7e68 100644
index e7e75d4d072..2e5a045415e 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -643,6 +643,7 @@ extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
@@ -646,6 +646,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,10 +208,10 @@ index df8a53bb228..afa990b7e68 100644
DWORD mask, DWORD flags ) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 43c30ab369c..d8576949aea 100644
index f1e50f56659..11ecf7aeed8 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -616,6 +616,7 @@ static BOOL process_attach(void)
@@ -617,6 +617,7 @@ static BOOL process_attach(void)
if (use_xkb) use_xkb = XkbUseExtension( gdi_display, NULL, NULL );
#endif
X11DRV_InitKeyboard( gdi_display );