From 9cb0330037c7f38d30777086e8222ba09cfc8916 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 4 Apr 2023 10:40:07 +1000 Subject: [PATCH] Rebase against 64cca153292833151d1adeb185252ca57e2d1625. --- ...-Split-XInput2-thread-initialization.patch | 10 ++-- ...-track-of-pointer-and-device-button-.patch | 14 ++--- ...en-to-RawMotion-and-RawButton-events.patch | 34 +++++------ ...te-a-candidate-window-s-position-wit.patch | 59 ++++++++----------- staging/upstream-commit | 2 +- 5 files changed, 55 insertions(+), 64 deletions(-) diff --git a/patches/user32-rawinput-mouse/0001-winex11.drv-Split-XInput2-thread-initialization.patch b/patches/user32-rawinput-mouse/0001-winex11.drv-Split-XInput2-thread-initialization.patch index 364a0e73..4a98955c 100644 --- a/patches/user32-rawinput-mouse/0001-winex11.drv-Split-XInput2-thread-initialization.patch +++ b/patches/user32-rawinput-mouse/0001-winex11.drv-Split-XInput2-thread-initialization.patch @@ -1,4 +1,4 @@ -From 5cd6a66d34a8844d757413804a6b4b358075993d Mon Sep 17 00:00:00 2001 +From a96d0f2e49227bab4a3181ce083afabb65adb950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 17 Jan 2020 16:33:11 +0100 Subject: [PATCH] winex11.drv: Split XInput2 thread initialization. @@ -93,7 +93,7 @@ index c34f5fde77e..f9cf4a33255 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 10a68779003..a8bbc207007 100644 +index 9ceec5ee6d8..dbdb9c530bb 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -258,7 +258,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN; @@ -107,7 +107,7 @@ index 10a68779003..a8bbc207007 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 03a09a32d8a..657d8f52db0 100644 +index 3a1e1973b24..6457c0a0b93 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -704,7 +704,7 @@ static NTSTATUS x11drv_init( void *arg ) @@ -121,7 +121,7 @@ index 03a09a32d8a..657d8f52db0 100644 X11DRV_InitKeyboard( gdi_display ); @@ -794,6 +794,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) - if (use_xim) X11DRV_SetupXIM(); + if (use_xim) xim_thread_attach( data ); + x11drv_xinput_init(); + @@ -129,5 +129,5 @@ index 03a09a32d8a..657d8f52db0 100644 } -- -2.39.2 +2.40.0 diff --git a/patches/user32-rawinput-mouse/0004-winex11.drv-Keep-track-of-pointer-and-device-button-.patch b/patches/user32-rawinput-mouse/0004-winex11.drv-Keep-track-of-pointer-and-device-button-.patch index 4dd2e1f8..44feeb66 100644 --- a/patches/user32-rawinput-mouse/0004-winex11.drv-Keep-track-of-pointer-and-device-button-.patch +++ b/patches/user32-rawinput-mouse/0004-winex11.drv-Keep-track-of-pointer-and-device-button-.patch @@ -1,4 +1,4 @@ -From 9f8722c6be41731d7913f804591a0c28999340cf Mon Sep 17 00:00:00 2001 +From a09b36f783354e7cdd1e44fc57195b0136c8b2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= 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 . 4 files changed, 106 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c -index 616728be621..5d02da68313 100644 +index b1c47d5258e..c6a167dc4c6 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c -@@ -1863,13 +1863,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event ) +@@ -1811,13 +1811,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event ) { HWND hwnd; @@ -196,7 +196,7 @@ 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 20172a99853..4394ea6d001 100644 +index 7fcb9300ba0..38cacb4d3d4 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; @@ -208,7 +208,7 @@ index 20172a99853..4394ea6d001 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 657d8f52db0..142bd596dd3 100644 +index 6457c0a0b93..e449530749e 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 ) @@ -216,9 +216,9 @@ index 657d8f52db0..142bd596dd3 100644 XkbUseExtension( gdi_display, NULL, NULL ); X11DRV_InitKeyboard( gdi_display ); + X11DRV_InitMouse( gdi_display ); - if (use_xim) use_xim = X11DRV_InitXIM( input_style ); + if (use_xim) use_xim = xim_init( input_style ); init_user_driver(); -- -2.39.2 +2.40.0 diff --git a/patches/user32-rawinput-mouse/0008-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch b/patches/user32-rawinput-mouse/0008-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch index 1b91ddb3..ec5432d7 100644 --- a/patches/user32-rawinput-mouse/0008-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch +++ b/patches/user32-rawinput-mouse/0008-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch @@ -1,4 +1,4 @@ -From 43a54849310a49babfee6c7ea08d92c4535514c3 Mon Sep 17 00:00:00 2001 +From 5cf6861a6cff5f3f3bee4694f07ba8679cba607d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 25 Oct 2021 11:45:47 +0200 Subject: [PATCH] winex11.drv: Listen to RawMotion and RawButton* events in the @@ -15,7 +15,7 @@ instance used in our dinput implementation. 4 files changed, 112 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c -index c8833671f12..a7bd4312737 100644 +index ff654ae6647..33a3aca953d 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -320,6 +320,10 @@ static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawE @@ -54,7 +54,7 @@ index c8833671f12..a7bd4312737 100644 #endif } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c -index 17e88f87982..8547553215c 100644 +index bb9807bf850..919cc8c7fb8 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -413,7 +413,18 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask ) @@ -77,7 +77,7 @@ index 17e88f87982..8547553215c 100644 pXISelectEvents( display, DefaultRootWindow( display ), &mask, 1 ); -@@ -767,7 +778,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU +@@ -766,7 +777,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU sync_window_cursor( window ); last_cursor_change = input->u.mi.time; } @@ -86,7 +86,7 @@ index 17e88f87982..8547553215c 100644 return; } -@@ -808,7 +819,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU +@@ -807,7 +818,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU SERVER_END_REQ; } @@ -95,7 +95,7 @@ index 17e88f87982..8547553215c 100644 } #ifdef SONAME_LIBXCURSOR -@@ -1791,7 +1802,6 @@ void move_resize_window( HWND hwnd, int dir ) +@@ -1790,7 +1801,6 @@ void move_resize_window( HWND hwnd, int dir ) { MSG msg; INPUT input; @@ -103,7 +103,7 @@ index 17e88f87982..8547553215c 100644 int x, y, rootX, rootY; if (!XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &x, &y, &xstate )) break; -@@ -1807,7 +1817,7 @@ void move_resize_window( HWND hwnd, int dir ) +@@ -1806,7 +1816,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 +112,7 @@ index 17e88f87982..8547553215c 100644 } while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE )) -@@ -2019,6 +2029,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +@@ -2018,6 +2028,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) */ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) { @@ -120,7 +120,7 @@ index 17e88f87982..8547553215c 100644 XIRawEvent *event = xev->data; RAWINPUT rawinput; INPUT input; -@@ -2038,7 +2049,85 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) +@@ -2037,7 +2048,85 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) input.u.mi.dy = 0; if (!map_raw_event_coords( event, &input )) return FALSE; @@ -207,7 +207,7 @@ index 17e88f87982..8547553215c 100644 return TRUE; } -@@ -2114,6 +2203,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) +@@ -2113,6 +2202,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) case XI_RawMotion: ret = X11DRV_RawMotion( event ); break; @@ -219,10 +219,10 @@ index 17e88f87982..8547553215c 100644 default: TRACE( "Unhandled event %#x\n", event->evtype ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index 5f1a5ecaecd..7325d3ff9aa 100644 +index 38cacb4d3d4..fcae7bbc9df 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h -@@ -404,6 +404,7 @@ struct x11drv_thread_data +@@ -405,6 +405,7 @@ struct x11drv_thread_data XIValuatorClassInfo x_valuator; XIValuatorClassInfo y_valuator; int xi2_core_pointer; /* XInput2 core pointer id */ @@ -231,10 +231,10 @@ index 5f1a5ecaecd..7325d3ff9aa 100644 }; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c -index 6707a64bcf6..c984639dbf9 100644 +index e449530749e..42de6c0e7a7 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c -@@ -733,6 +733,8 @@ void X11DRV_ThreadDetach(void) +@@ -728,6 +728,8 @@ void X11DRV_ThreadDetach(void) if (data) { vulkan_thread_detach(); @@ -243,8 +243,8 @@ index 6707a64bcf6..c984639dbf9 100644 if (data->xim) XCloseIM( data->xim ); if (data->font_set) XFreeFontSet( data->display, data->font_set ); XCloseDisplay( data->display ); -@@ -804,6 +806,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) - if (use_xim) X11DRV_SetupXIM(); +@@ -796,6 +798,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) + if (use_xim) xim_thread_attach( data ); x11drv_xinput_init(); + if (NtUserGetWindowThread( NtUserGetDesktopWindow(), NULL ) == GetCurrentThreadId()) @@ -253,5 +253,5 @@ index 6707a64bcf6..c984639dbf9 100644 return data; } -- -2.38.1 +2.40.0 diff --git a/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch b/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch index 6a8844b4..b50b30e3 100644 --- a/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch +++ b/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch @@ -1,4 +1,4 @@ -From f57059086630af68cf9469074c1630d32e607e15 Mon Sep 17 00:00:00 2001 +From c7e30e022ebe93ed29114af743c63898bc15c04d Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 23 Sep 2014 23:22:17 +0800 Subject: [PATCH] winex11.drv: Update a candidate window's position with @@ -21,15 +21,15 @@ received a lot of help from Sebastian Lackner. dlls/win32u/input.c | 2 ++ dlls/winex11.drv/init.c | 1 + dlls/winex11.drv/x11drv.h | 1 + - dlls/winex11.drv/xim.c | 72 ++++++++++++++++++++++++++++++++++++++- + dlls/winex11.drv/xim.c | 70 +++++++++++++++++++++++++++++++++++++++ include/wine/gdi_driver.h | 2 ++ - 6 files changed, 84 insertions(+), 1 deletion(-) + 6 files changed, 83 insertions(+) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c -index 526bb5db19c..d18a8121f1f 100644 +index a2ac8fbf815..ffd0c0e6e5a 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c -@@ -893,6 +893,11 @@ static struct opengl_funcs *nulldrv_wine_get_wgl_driver( UINT version ) +@@ -910,6 +910,11 @@ static struct opengl_funcs *nulldrv_wine_get_wgl_driver( UINT version ) return (void *)-1; } @@ -41,7 +41,7 @@ index 526bb5db19c..d18a8121f1f 100644 static void nulldrv_ThreadDetach( void ) { } -@@ -1188,6 +1193,7 @@ static const struct user_driver_funcs lazy_load_driver = +@@ -1225,6 +1230,7 @@ static const struct user_driver_funcs lazy_load_driver = loaderdrv_wine_get_vulkan_driver, /* opengl support */ nulldrv_wine_get_wgl_driver, @@ -49,7 +49,7 @@ index 526bb5db19c..d18a8121f1f 100644 /* thread management */ nulldrv_ThreadDetach, }; -@@ -1258,6 +1264,7 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v +@@ -1298,6 +1304,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version SET_USER_FUNC(SystemParametersInfo); SET_USER_FUNC(wine_get_vulkan_driver); SET_USER_FUNC(wine_get_wgl_driver); @@ -58,10 +58,10 @@ index 526bb5db19c..d18a8121f1f 100644 #undef SET_USER_FUNC diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c -index 658258f73ee..8ecacb763c7 100644 +index f1eb5f3a8ca..31ed6a62812 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c -@@ -2035,6 +2035,7 @@ BOOL set_caret_pos( int x, int y ) +@@ -2320,6 +2320,7 @@ BOOL set_caret_pos( int x, int y ) r.left = x; r.top = y; display_caret( hwnd, &r ); @@ -69,7 +69,7 @@ index 658258f73ee..8ecacb763c7 100644 NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, caret.timeout ); } return ret; -@@ -2072,6 +2073,7 @@ BOOL WINAPI NtUserShowCaret( HWND hwnd ) +@@ -2357,6 +2358,7 @@ BOOL WINAPI NtUserShowCaret( HWND hwnd ) if (ret && hidden == 1) /* hidden was 1 so it's now 0 */ { display_caret( hwnd, &r ); @@ -78,10 +78,10 @@ index 658258f73ee..8ecacb763c7 100644 } return ret; diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c -index 60232e4ca7b..846ead80a4a 100644 +index 2d056a359ef..eb57a2fcffb 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c -@@ -433,6 +433,7 @@ static const struct user_driver_funcs x11drv_funcs = +@@ -439,6 +439,7 @@ static const struct user_driver_funcs x11drv_funcs = .pSystemParametersInfo = X11DRV_SystemParametersInfo, .pwine_get_vulkan_driver = X11DRV_wine_get_vulkan_driver, .pwine_get_wgl_driver = X11DRV_wine_get_wgl_driver, @@ -90,10 +90,10 @@ index 60232e4ca7b..846ead80a4a 100644 }; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index ac540df004c..ba56b1e127c 100644 +index fcae7bbc9df..77b4c1a3b81 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h -@@ -245,6 +245,7 @@ extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flag +@@ -253,6 +253,7 @@ extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flag struct window_surface *surface ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags ) DECLSPEC_HIDDEN; @@ -102,7 +102,7 @@ index ac540df004c..ba56b1e127c 100644 /* X11 driver internal functions */ diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c -index 00c15bb3bcf..280bfe5bf3c 100644 +index 9f238e0cb83..2bda8ffc65f 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -34,6 +34,7 @@ @@ -113,7 +113,7 @@ index 00c15bb3bcf..280bfe5bf3c 100644 WINE_DEFAULT_DEBUG_CHANNEL(xim); -@@ -449,6 +450,48 @@ static BOOL X11DRV_DestroyIC(XIC xic, XPointer p, XPointer data) +@@ -459,6 +460,49 @@ static BOOL xic_destroy( XIC xic, XPointer user, XPointer arg ) return TRUE; } @@ -159,23 +159,14 @@ index 00c15bb3bcf..280bfe5bf3c 100644 + } + } +} - - XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) ++ + XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data ) { -@@ -483,7 +526,7 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) - XNDestroyCallback, &destroy, - NULL); - data->xic = xic; -- return xic; -+ goto return_xic; - } + XICCallback destroy = {.callback = xic_destroy, .client_data = (XPointer)hwnd}; +@@ -492,5 +536,31 @@ XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data ) + XFree( preedit ); + XFree( status ); - /* create callbacks */ -@@ -581,5 +624,32 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) - if (status != NULL) - XFree(status); - -+return_xic: + if (xic != NULL && (ximStyle & XIMPreeditPosition)) + { + SERVER_START_REQ( set_caret_info ) @@ -205,10 +196,10 @@ index 00c15bb3bcf..280bfe5bf3c 100644 return xic; } diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h -index d9c52777dd8..532e4bdcd9e 100644 +index 52bfaaefbfd..8afb19fd6ec 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h -@@ -325,6 +325,8 @@ struct user_driver_funcs +@@ -334,6 +334,8 @@ struct user_driver_funcs const struct vulkan_funcs * (*pwine_get_vulkan_driver)(UINT); /* opengl support */ struct opengl_funcs * (*pwine_get_wgl_driver)(UINT); @@ -218,5 +209,5 @@ index d9c52777dd8..532e4bdcd9e 100644 void (*pThreadDetach)(void); }; -- -2.35.1 +2.40.0 diff --git a/staging/upstream-commit b/staging/upstream-commit index 6e5ccc1a..f2d08e16 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -02876a4b1320a1ee03b04c264fe31ccf6ec06d1c +64cca153292833151d1adeb185252ca57e2d1625