Bruno Jesus : dinput: Simplify JoystickWImpl_Unacquire for Linux.

Alexandre Julliard julliard at winehq.org
Mon Jan 30 15:39:16 CST 2017


Module: wine
Branch: master
Commit: 8339de07ca51723faf3ff25f81f331233f337c5c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8339de07ca51723faf3ff25f81f331233f337c5c

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Thu Jan 26 17:07:04 2017 -0200

dinput: Simplify JoystickWImpl_Unacquire for Linux.

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/joystick_linuxinput.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index f62893b..910e755 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -88,6 +88,8 @@ HRESULT linuxinput_create_effect(int* fd, REFGUID rguid, struct list *parent_lis
 HRESULT linuxinput_get_info_A(int fd, REFGUID rguid, LPDIEFFECTINFOA info);
 HRESULT linuxinput_get_info_W(int fd, REFGUID rguid, LPDIEFFECTINFOW info);
 
+static HRESULT WINAPI JoystickWImpl_SendForceFeedbackCommand(LPDIRECTINPUTDEVICE8W iface, DWORD dwFlags);
+
 typedef struct JoystickImpl JoystickImpl;
 static const IDirectInputDevice8AVtbl JoystickAvt;
 static const IDirectInputDevice8WVtbl JoystickWvt;
@@ -745,18 +747,10 @@ static HRESULT WINAPI JoystickWImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
     TRACE("(this=%p)\n",This);
     res = IDirectInputDevice2WImpl_Unacquire(iface);
     if (res==DI_OK && This->joyfd!=-1) {
-      effect_list_item *itr;
       struct input_event event;
 
-      /* For each known effect:
-       * - stop it
-       * - unload it
-       * But, unlike DISFFC_RESET, do not release the effect.
-       */
-      LIST_FOR_EACH_ENTRY(itr, &This->ff_effects, effect_list_item, entry) {
-          IDirectInputEffect_Stop(itr->ref);
-          IDirectInputEffect_Unload(itr->ref);
-      }
+      /* Stop and unload all effects */
+      JoystickWImpl_SendForceFeedbackCommand(iface, DISFFC_RESET);
 
       /* Enable autocenter. */
       event.type = EV_FF;




More information about the wine-cvs mailing list