winex11: Forward all clipping requests to the right thread.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38087
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2019-03-18 13:39:57 +01:00 committed by Alexandre Julliard
parent dd67345ea4
commit e2389c015c
1 changed files with 15 additions and 15 deletions

View File

@ -464,6 +464,8 @@ void reset_clipping_window(void)
ClipCursor( NULL ); /* make sure the clip rectangle is reset too */
}
BOOL CDECL X11DRV_ClipCursor( const RECT *clip );
/***********************************************************************
* clip_cursor_notify
*
@ -492,12 +494,10 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd )
}
else if (hwnd == GetForegroundWindow()) /* request to clip */
{
RECT clip, virtual_rect = get_virtual_screen_rect();
RECT clip;
GetClipCursor( &clip );
if (clip.left > virtual_rect.left || clip.right < virtual_rect.right ||
clip.top > virtual_rect.top || clip.bottom < virtual_rect.bottom)
return grab_clipping_window( &clip );
X11DRV_ClipCursor( &clip );
}
return 0;
}
@ -1471,11 +1471,6 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip )
if (grab_pointer)
{
HWND foreground = GetForegroundWindow();
/* we are clipping if the clip rectangle is smaller than the screen */
if (clip->left > virtual_rect.left || clip->right < virtual_rect.right ||
clip->top > virtual_rect.top || clip->bottom < virtual_rect.bottom)
{
DWORD tid, pid;
/* forward request to the foreground window if it's in a different thread */
@ -1486,7 +1481,12 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip )
SendNotifyMessageW( foreground, WM_X11DRV_CLIP_CURSOR, 0, 0 );
return TRUE;
}
else if (grab_clipping_window( clip )) return TRUE;
/* we are clipping if the clip rectangle is smaller than the screen */
if (clip->left > virtual_rect.left || clip->right < virtual_rect.right ||
clip->top > virtual_rect.top || clip->bottom < virtual_rect.bottom)
{
if (grab_clipping_window( clip )) return TRUE;
}
else /* if currently clipping, check if we should switch to fullscreen clipping */
{