---
This is caused by some focus override issue, that is resolved by Gabriel's patch. SetActiveWindow succeeds but is overriden by the focus messages from the hwnd2 creation that are processed late.
dlls/dinput/tests/mouse.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c index e4d24e89165..9b269f72ef6 100644 --- a/dlls/dinput/tests/mouse.c +++ b/dlls/dinput/tests/mouse.c @@ -148,17 +148,26 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd) ok(hr == S_OK && cnt > 0, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
mouse_event(MOUSEEVENTF_MOVE, 10, 10, 0, 0); - IDirectInputDevice_Unacquire(pMouse); + hr = IDirectInputDevice_Unacquire(pMouse); + todo_wine + ok(hr == S_OK, "Unacquire() failed: %08x\n", hr); cnt = 1; hr = IDirectInputDevice_GetDeviceData(pMouse, sizeof(mouse_state), &mouse_state, &cnt, 0); ok(hr == S_OK && cnt > 0, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
- IDirectInputDevice_Acquire(pMouse); + hr = IDirectInputDevice_Acquire(pMouse); + todo_wine + ok(hr == S_OK, "Acquire() failed: %08x\n", hr); mouse_event(MOUSEEVENTF_MOVE, 10, 10, 0, 0); - IDirectInputDevice_Unacquire(pMouse); - IDirectInputDevice_Acquire(pMouse); + hr = IDirectInputDevice_Unacquire(pMouse); + todo_wine + ok(hr == S_OK, "Unacquire() failed: %08x\n", hr); + hr = IDirectInputDevice_Acquire(pMouse); + todo_wine + ok(hr == S_OK, "Acquire() failed: %08x\n", hr); cnt = 1; hr = IDirectInputDevice_GetDeviceData(pMouse, sizeof(mouse_state), &mouse_state, &cnt, 0); + todo_wine ok(hr == S_OK && cnt > 0, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
/* Check for buffer overflow */ @@ -170,6 +179,7 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd) ok(hr == DI_OK, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt); cnt = 1; hr = IDirectInputDevice_GetDeviceData(pMouse, sizeof(mouse_state), &mouse_state, &cnt, 0); + todo_wine ok(hr == DI_OK && cnt == 1, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
/* Check for granularity property using BYOFFSET */ -- 2.23.0.rc1
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=55864
Your paranoid android.
=== debian10 (32 bit French report) ===
dinput: mouse.c:171: Test succeeded inside todo block: GetDeviceData() failed: 00000000 cnt:1
AFAICS, it still spuriously succeeds (or fails depending on how you see it), as it depends on how fast the windows are created and the focus events received and processed.
Maybe this means that we should instead wait until the window get focus right after they are created in winex11 instead of trying to return early and hope to keep things consistent afterwards.