Rebase against 8ddff3f51faca2c0824e204a69f69e241fb93d15.

This commit is contained in:
Alistair Leslie-Hughes
2021-05-26 10:10:15 +10:00
parent 69765f438b
commit 34afd80e2e
7 changed files with 49 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
From e72af998f5382092726cfdb4d57c3b5f8b7d5401 Mon Sep 17 00:00:00 2001
From 598845132c5c0b49bb088b6e70a4127bc81924fb Mon Sep 17 00:00:00 2001
From: Andrew Church <achurch@achurch.org>
Date: Mon, 25 Feb 2019 11:23:12 +1100
Subject: [PATCH] dinput: Allow reconnecting to disconnected joysticks
@@ -9,7 +9,7 @@ Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=34297
1 file changed, 113 insertions(+), 35 deletions(-)
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index b5418d805cc..2434af600ac 100644
index 14acbb5cd8c..ef7b160ba58 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -84,6 +84,13 @@ struct wine_input_absinfo {
@@ -34,7 +34,7 @@ index b5418d805cc..2434af600ac 100644
int dev_axes_to_di[ABS_MAX];
POINTL povs[4];
@@ -473,6 +481,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, IDirectInputImpl *dinput, unsig
@@ -468,6 +476,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, IDirectInputImpl *dinput, unsig
newDevice->generic.base.dinput = dinput;
newDevice->generic.joy_polldev = joy_polldev;
newDevice->joyfd = -1;
@@ -42,7 +42,7 @@ index b5418d805cc..2434af600ac 100644
newDevice->joydev = &joydevs[index];
newDevice->generic.name = newDevice->joydev->name;
list_init(&newDevice->ff_effects);
@@ -680,38 +689,15 @@ static HRESULT joydev_create_device(IDirectInputImpl *dinput, REFGUID rguid, REF
@@ -675,38 +684,15 @@ static HRESULT joydev_create_device(IDirectInputImpl *dinput, REFGUID rguid, REF
return DIERR_DEVICENOTREG;
}
@@ -85,7 +85,7 @@ index b5418d805cc..2434af600ac 100644
}
else
{
@@ -726,18 +712,53 @@ static HRESULT WINAPI JoystickWImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
@@ -721,18 +707,53 @@ static HRESULT WINAPI JoystickWImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
event.type = EV_FF;
event.code = FF_GAIN;
event.value = This->ff_gain;
@@ -141,7 +141,7 @@ index b5418d805cc..2434af600ac 100644
return DI_OK;
}
@@ -775,6 +796,7 @@ static HRESULT WINAPI JoystickWImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
@@ -764,6 +785,7 @@ static HRESULT WINAPI JoystickWImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
close(This->joyfd);
This->joyfd = -1;
@@ -149,9 +149,9 @@ index b5418d805cc..2434af600ac 100644
}
return res;
}
@@ -819,23 +841,79 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface)
@@ -802,23 +824,79 @@ static void joy_polldev( IDirectInputDevice8W *iface )
struct input_event ie;
JoystickImpl *This = impl_from_IDirectInputDevice8A(iface);
JoystickImpl *This = impl_from_IDirectInputDevice8W( iface );
- if (This->joyfd==-1)
- return;
@@ -236,5 +236,5 @@ index b5418d805cc..2434af600ac 100644
TRACE("input_event: type %d, code %d, value %d\n",ie.type,ie.code,ie.value);
switch (ie.type) {
--
2.17.1
2.30.2