Commit 8d10b5ce authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

user32: Use the original message's wparam during the double-click comparison.

parent e60bc27d
......@@ -2490,6 +2490,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
GUITHREADINFO info;
MOUSEHOOKSTRUCTEX hook;
BOOL eatMsg;
WPARAM wparam;
/* find the window to dispatch this mouse message to */
......@@ -2523,13 +2524,14 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
pt = msg->pt;
message = msg->message;
wparam = msg->wParam;
/* Note: windows has no concept of a non-client wheel message */
if (message != WM_MOUSEWHEEL)
{
if (hittest != HTCLIENT)
{
message += WM_NCMOUSEMOVE - WM_MOUSEMOVE;
msg->wParam = hittest;
wparam = hittest;
}
else
{
......@@ -2581,6 +2583,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
{
if (message < first || message > last) return FALSE;
}
msg->wParam = wparam;
/* message is accepted now (but may still get dropped) */
......
......@@ -3759,7 +3759,7 @@ static void test_mouse_input(HWND hwnd)
RECT rc;
POINT pt;
int x, y;
HWND popup;
HWND popup, child = NULL;
MSG msg;
BOOL ret;
LRESULT res;
......@@ -3948,10 +3948,72 @@ static void test_mouse_input(HWND hwnd)
TEST_MOUSEACTIVATE(HTCLOSE,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTHELP,MA_ACTIVATE);
ShowWindow(popup, SW_HIDE);
/* Test sending double click to the non-client area, while capturing the window after
the first click has been processed. Use a child window to ensure that Wine's graphics
driver isn't managing the non-client area. */
GetWindowRect(hwnd, &rc);
child = CreateWindowExA(0, "MainWindowClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_VISIBLE,
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
hwnd, 0, 0, NULL);
GetWindowRect(child, &rc);
UpdateWindow(child);
SetCursorPos( rc.left + 5, rc.top + 5 );
flush_events( TRUE );
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
todo_wine
ok(msg.hwnd == child && msg.message == WM_NCMOUSEMOVE, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
if (msg.message == WM_NCMOUSEMOVE)
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
ok(msg.hwnd == child && msg.message == WM_NCLBUTTONDOWN, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
ok(msg.wParam == HTSYSMENU, "wparam %ld\n", msg.wParam);
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
ok(msg.hwnd == child && msg.message == WM_NCLBUTTONUP, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
SetCapture( child );
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
ok(msg.hwnd == child && msg.message == WM_LBUTTONDBLCLK, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
ok(msg.wParam == MK_LBUTTON, "wparam %ld\n", msg.wParam);
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
todo_wine
ok(msg.hwnd == child && (msg.message == WM_NCMOUSELEAVE || broken(msg.message == WM_LBUTTONUP)),
"hwnd %p/%p message %04x\n", msg.hwnd, child, msg.message);
if (msg.message == WM_NCMOUSELEAVE)
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
ok(msg.hwnd == child && msg.message == WM_LBUTTONUP, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
ret = peek_message(&msg);
ok(!ret, "message %04x available\n", msg.message);
done:
/* Clear any messages left behind by WM_MOUSEACTIVATE tests */
flush_events( TRUE );
if (child) DestroyWindow(child);
DestroyWindow(popup);
}
......
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