Commit 0d9ce8a0 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

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: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent b1f8a91e
......@@ -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 ))
......
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