Commit 432858b2 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winex11.drv: Don't wait for the desktop thread to store clipping window.

The messages are in flight, the state will be updated eventually in the order they are received by the desktop thread, we shouldn't have to wait. If the clipping window gets overwritten, it will also receive a message from the desktop thread, which is sent asynchronously already. Call of Duty: WWII calls ClipCursor in a loop on startup while the foreground thread is stalled and the messages sometimes pile up. The recursive message processing that SendMessageW induces can then cause stack overflows. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49643Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f9490876
......@@ -445,7 +445,7 @@ static BOOL grab_clipping_window( const RECT *clip )
if (!data->clip_hwnd) sync_window_cursor( clip_window );
InterlockedExchangePointer( (void **)&cursor_window, msg_hwnd );
data->clip_hwnd = msg_hwnd;
SendMessageW( GetDesktopWindow(), WM_X11DRV_CLIP_CURSOR, 0, (LPARAM)msg_hwnd );
SendNotifyMessageW( GetDesktopWindow(), WM_X11DRV_CLIP_CURSOR, 0, (LPARAM)msg_hwnd );
return TRUE;
}
......@@ -465,7 +465,7 @@ void ungrab_clipping_window(void)
XUnmapWindow( display, clip_window );
if (clipping_cursor) XUngrabPointer( display, CurrentTime );
clipping_cursor = FALSE;
SendMessageW( GetDesktopWindow(), WM_X11DRV_CLIP_CURSOR, 0, 0 );
SendNotifyMessageW( GetDesktopWindow(), WM_X11DRV_CLIP_CURSOR, 0, 0 );
}
/***********************************************************************
......
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