[PATCH 4/4] xinput1_3: Register device notifications in DllMain.

Rémi Bernon rbernon at codeweavers.com
Fri Dec 24 04:29:06 CST 2021


On 12/23/21 15:33, Rémi Bernon wrote:
> Instead of doing it lazily, which is more likely to be after the game
> has registered theirs. As the message handling order is the same as the
> registration, XInput may end updating its device list only too late,
> every time.
> 
> Some games register device notifications and call XInputGetCapabilities
> or XInputGetState from their window proc, expecting XInput controller
> list to be updated already. If the controller is missing they won't try
> calling XInput functions again until another WM_DEVICECHANGE message is
> received.
> 
> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
> ---

Yeah, thanks for ignoring this. Having a better look it looks like this 
can better be solved through I_ScRegisterDeviceNotification filters.

The internal XInput device should already be sending its WM_DEVICECHANGE 
message first, and only then the HID interface the game may be watching for.

As we don't have filter implementation yet, the game reacts to the first 
message (and for some reason differently on the second one), before 
XInput can refresh its device list.

-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list