Repository navigation
Conversation
DIDFT_ANYINSTANCE is not a valid EnumObjects filter. Native Windows ignores it, but current Wine returns DIERR_INVALIDPARAM, leaving the mouse with no inputs. Pass only DIDFT_BUTTON | DIDFT_AXIS and log if EnumObjects fails.
Member
|
this pull request is AI generated |
Author
|
mb, didn't know you had no AI policy. Can i redo the PR with my own words? It's a useful fix and I already tested it with the compiled windows version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running the Windows build under Wine/Proton (recent versions, e.g. GE-Proton 11),
the mouse is not detected at all: no cursor movement, no clicks. The log shows:
Cause
DIDevice::Openenumerates the mouse objects with:DIDFT_ANYINSTANCEis meant to identify an object's instance (it is part ofdwType), not to be used as anEnumObjectsfilter. Native Windows and olderWine ignore the extra bits, but current Wine validates the flags and returns
DIERR_INVALIDPARAMif anything other thanDIDFT_AXIS | DIDFT_POV | DIDFT_BUTTON | DIDFT_NODATA | DIDFT_COLLECTIONis passed(
dlls/dinput/device.c,dinput_device_EnumObjects).The return value is not checked, so the mouse ends up registered with an empty
Inputslist. The DirectInput thread then never emits mouse events, and thecursor location (updated from
GetCursorPoswhen an event is processed) isnever refreshed either.
Fix
Pass only
DIDFT_BUTTON | DIDFT_AXIS, which is what the callback actuallyhandles. The
SupportedMaskcheck inDIMouse_EnumDevObjectsProcis updatedaccordingly, and a failing
EnumObjectsis now logged.Testing
including Windows x64).
Wayland): the mouse is now detected (
'Wine Mouse' axes: 3, hats: 0, buttons: 5) and works in menus. Before the change it reported 0 axes and0 buttons and the mouse did nothing.
effect there.
I used an AI assistant to help investigate and draft this change; I tested it myself.