dinput: Initialize js state with sane values when the application acquires the device instead of at allocation.

Vitaliy Margolen wine-devel at kievinfo.com
Fri Jan 1 15:44:43 CST 2010


Loïc Hoguin wrote:
> See the attached patch.
> 
> +    /* Get sane state values for the joystick before giving control to the application.
> +       Before this call was made in alloc_device, before the application sets the joystick
> +       properties, so the values given by fake_current_js_state weren't in the range
> +       of values expected by a few applications. */
> +    fake_current_js_state(This);
> +

The comment is a bit too verbose. First line is enough.

However my main problem with your patch is you doing it on every acquire
call which invalidates prior state of the joystick which could have been
correct. I'm afraid you'll need to find a way to do it once or pull the real
device state from the device.

Vitaliy



More information about the wine-devel mailing list