user32: Add a heuristic to find the mouse message's window.

This can't be done properly without support from the native windowing
system.  However, it's a good bet to try the next window in the z-order
if it's the owner of the original window and it's in the same thread.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2018-02-06 10:08:25 +00:00 committed by Alexandre Julliard
parent b1f8a91e6c
commit 0d9ce8a025
1 changed files with 9 additions and 0 deletions

View File

@ -2502,7 +2502,16 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
}
else
{
HWND orig = msg->hwnd;
msg->hwnd = WINPOS_WindowFromPoint( msg->hwnd, msg->pt, &hittest );
if (!msg->hwnd) /* As a heuristic, try the next window if it's the owner of orig */
{
HWND next = GetWindow( orig, GW_HWNDNEXT );
if (next && GetWindow( orig, GW_OWNER ) == next && WIN_IsCurrentThread( next ))
msg->hwnd = WINPOS_WindowFromPoint( next, msg->pt, &hittest );
}
}
if (!msg->hwnd || !WIN_IsCurrentThread( msg->hwnd ))