Commit e5c6f915 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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.
parent 140456a0
...@@ -644,6 +644,7 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x ...@@ -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 ) static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
{ {
struct x11drv_win_data *data; struct x11drv_win_data *data;
Window win = 0;
input->type = INPUT_MOUSE; input->type = INPUT_MOUSE;
...@@ -665,13 +666,14 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU ...@@ -665,13 +666,14 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
} }
if (!(data = get_win_data( hwnd ))) return; if (!(data = get_win_data( hwnd ))) return;
win = data->whole_window;
release_win_data( data );
if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd || if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
input->u.mi.time - last_cursor_change > 100) 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; last_cursor_change = input->u.mi.time;
} }
release_win_data( data );
if (hwnd != NtUserGetDesktopWindow()) if (hwnd != NtUserGetDesktopWindow())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment