From: Paul Gofman pgofman@codeweavers.com
--- dlls/user32/tests/win.c | 4 ++++ dlls/win32u/input.c | 9 --------- server/queue.c | 2 ++ 3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 160d85f2190..8da4e11b635 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -13331,7 +13331,11 @@ static void test_ReleaseCapture(void) ok(wm_mousemove_count < 10, "Got too many WM_MOUSEMOVE.\n");
/* Test that ReleaseCapture() should send a WM_MOUSEMOVE if a window is captured */ + wm_mousemove_count = 0; SetCapture(hwnd); + flush_events(TRUE); + ok(!wm_mousemove_count, "Got no WM_MOUSEMOVE.\n"); + wm_mousemove_count = 0; ret = ReleaseCapture(); ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index ae7aeba90f7..69bd026c054 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1850,15 +1850,6 @@ BOOL release_capture(void) BOOL ret;
ret = set_capture_window( 0, 0, &previous ); - - /* Somebody may have missed some mouse movements */ - if (ret && previous) - { - INPUT input = { .type = INPUT_MOUSE }; - input.mi.dwFlags = MOUSEEVENTF_MOVE; - NtUserSendInput( 1, &input, sizeof(input) ); - } - return ret; }
diff --git a/server/queue.c b/server/queue.c index 76a82dcf712..466e135f278 100644 --- a/server/queue.c +++ b/server/queue.c @@ -3890,6 +3890,8 @@ DECL_HANDLER(set_capture_window) reply->full_handle = shared->capture; } SHARED_WRITE_END; + if (reply->previous && !req->handle && !req->flags) + update_cursor_pos(input->desktop); } }