https://bugs.winehq.org/show_bug.cgi?id=42570
Bug ID: 42570 Summary: dinput/tests/mouse intermittently fails in Acquire() and GetDeviceData() Product: Wine Version: 2.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dinput Assignee: wine-bugs@winehq.org Reporter: z.figura12@gmail.com Distribution: ---
Created attachment 57480 --> https://bugs.winehq.org/attachment.cgi?id=57480 log with +dinput
The following lines are sometimes printed:
mouse.c:143: Test failed: Acquire() should have failed: 00000000 mouse.c:147: Test failed: Acquire() failed: 00000001
Less often, 2-4 of the following lines may be printed as well:
mouse.c:152: Test failed: GetDeviceData() failed: 00000000 cnt:0 mouse.c:158: Test failed: GetDeviceData() failed: 00000000 cnt:0 mouse.c:166: Test failed: GetDeviceData() failed: 00000000 cnt:0 mouse.c:177: Test failed: GetDeviceData() failed: 00000000 cnt:0
This affects at least the f25 and hd6800 test machines. If there is any relevant information I can provide about my machine, please let me know.
https://bugs.winehq.org/show_bug.cgi?id=42570
--- Comment #1 from Zebediah Figura z.figura12@gmail.com --- Rerunning in 2.7 on a Manjaro machine I get only and always these two lines:
mouse.c:166: Test failed: GetDeviceData() failed: 00000000 cnt:0 mouse.c:177: Test failed: GetDeviceData() failed: 00000000 cnt:0
I would guess this is due to a difference in threading speed since the test machines seem to show the same behaviour as reported in my first comment.
https://bugs.winehq.org/show_bug.cgi?id=42570
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |51895145fd67d3dd055888caaba | |7af413e4753f6 Resolution|--- |FIXED
--- Comment #2 from Zebediah Figura z.figura12@gmail.com --- Fixed by 51895145fd67d3dd055888caaba7af413e4753f6.
I'm going to copy the patch comment here for posterity:
--- The purpose of this test is to ensure that the DirectInput device is unacquired when its associated window loses foreground status. Calling CreateWindow() is enough to achieve this; pumping messages is unnecessary for the test and causes an intermittent failure unrelated to DirectInput.
Specifically, due to the way our window managers are implemented (both X11 and Mac), upon creating a second window we actually appear to send WM_MOUSEACTIVATE messages twice, once for the window which will lose focus and once for the window which will gain it. The latter message is not always sent before the message pump completes, and so sometimes the simple sequence
hwnd = CreateWindow(...); hwnd2 = CreateWindow(...); while (PeekMessageA(...)) DispatchMessageA(&msg); ret = GetForegroundWindow();
will return hwnd rather than hwnd2.
This never occurs on Windows. I do not know whether this is a bug in Wine or X11/Quartz, or even if it is something that should be expected of Wine. If it is, I will submit the above as a test to user32/msg.c, although I would welcome any advice on how to render it a consistent rather than intermittent failure.
https://bugs.winehq.org/show_bug.cgi?id=42570
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.21.
https://bugs.winehq.org/show_bug.cgi?id=42570
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=42570
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #4 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.5.