Module: wine Branch: master Commit: e5c6f915bbd7290641ea43fb41429317bc7e7a80 URL: https://gitlab.winehq.org/wine/wine/-/commit/e5c6f915bbd7290641ea43fb4142931...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Wed Nov 30 12:28:10 2022 +0800
winex11.drv: Release window data before calling sync_window_cursor().
This prevents a deadlock between the window data lock and the ntdll loader lock because sync_window_cursor() eventually may grab the ntdll loader lock. So if another thread already grabbed the ntdll loader lock and wants to enter the same window data critical section, it will deadlock.
Fix Youropa (SteamID: 640120) OpenGL launch option launching to a black screen.
---
dlls/winex11.drv/mouse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index ebc8be643af..d1ade2eda68 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -644,6 +644,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; + Window win = 0;
input->type = INPUT_MOUSE;
@@ -665,13 +666,14 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU }
if (!(data = get_win_data( hwnd ))) return; + win = data->whole_window; + release_win_data( data ); if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd || input->u.mi.time - last_cursor_change > 100) { - sync_window_cursor( data->whole_window ); + sync_window_cursor( win ); last_cursor_change = input->u.mi.time; } - release_win_data( data );
if (hwnd != NtUserGetDesktopWindow()) {