user32: Try harder to find a target for mouse messages

Dmitry Timoshkov dmitry at
Fri Mar 14 03:18:24 CDT 2008


this patch fixes the problem reported in the bug 12007.

X11 sends a ButtonRelease event to the same window which got ButtonPress one
(can be easily verified with xev), but Windows sends WM_LBUTTONUP message to
the window above which a user has released mouse button (as shown by spy++).
In the case of Photoshop7 ButtonRelease event (and later WM_LBUTTONUP message)
are sent to a tool palette window (with parent desktop) instead of an MDI child

    user32: Try harder to find a target for mouse messages.
 dlls/user32/message.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index eb0168f..e85ac1c 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -1770,7 +1770,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
-        msg->hwnd = WINPOS_WindowFromPoint( msg->hwnd, msg->pt, &hittest );
+        msg->hwnd = WINPOS_WindowFromPoint( 0, msg->pt, &hittest );
     if (!msg->hwnd || !WIN_IsCurrentThread( msg->hwnd ))

More information about the wine-patches mailing list