diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 822c266eba6..8f5d1c0b973 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -13112,7 +13112,6 @@ static void test_ReleaseCapture(void) ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); flush_events(TRUE); do_release_capture = FALSE; - todo_wine ok(wm_mousemove_count < 10, "Got too many WM_MOUSEMOVE.\n"); /* Test that ReleaseCapture() should send a WM_MOUSEMOVE if a window is captured */ @@ -13128,7 +13127,6 @@ static void test_ReleaseCapture(void) ret = ReleaseCapture(); ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); flush_events(TRUE); - todo_wine ok(wm_mousemove_count == 0, "Got WM_MOUSEMOVE.\n"); ret = SetCursorPos(pt.x, pt.y); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 69bc57f3ca4..9acdeb40388 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1803,10 +1803,13 @@ HWND WINAPI NtUserSetCapture( HWND hwnd ) */ BOOL release_capture(void) { - BOOL ret = set_capture_window( 0, 0, NULL ); + HWND previous = NULL; + BOOL ret; + + ret = set_capture_window( 0, 0, &previous ); /* Somebody may have missed some mouse movements */ - if (ret) + if (ret && previous) { INPUT input = { .type = INPUT_MOUSE }; input.mi.dwFlags = MOUSEEVENTF_MOVE;