Rémi Bernon : dinput: Always call the device internal poll callback.

Alexandre Julliard julliard at winehq.org
Mon Nov 8 15:45:05 CST 2021


Module: wine
Branch: master
Commit: 53fcfe3834da3c43838cd26bdeb4fdb335542627
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=53fcfe3834da3c43838cd26bdeb4fdb335542627

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Nov  8 09:34:57 2021 +0100

dinput: Always call the device internal poll callback.

We normally should not peek messages here, but because of current
winex11.drv design, we have to call MsgWaitForMultipleObjectsEx from
time to time to pull keyboard or mouse events.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51956
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/device.c      | 3 +--
 dlls/dinput/dinput_main.c | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index d375229e2c0..c79b182bc66 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -1535,10 +1535,9 @@ static HRESULT WINAPI dinput_device_Poll( IDirectInputDevice8W *iface )
     EnterCriticalSection( &impl->crit );
     if (!impl->acquired) hr = DIERR_NOTACQUIRED;
     LeaveCriticalSection( &impl->crit );
-    if (hr != DI_OK) return hr;
 
     if (impl->vtbl->poll) return impl->vtbl->poll( iface );
-    return DI_OK;
+    return hr;
 }
 
 static HRESULT WINAPI dinput_device_SendDeviceData( IDirectInputDevice8W *iface, DWORD size,
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 3286e887662..835a8656bd1 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -1430,6 +1430,8 @@ void check_dinput_events(void)
      *   (for example Culpa Innata)
      * - some games only poll the device, and neither keyboard nor mouse
      *   (for example Civilization: Call to Power 2)
+     * - some games do not explicitly poll for keyboard events
+     *   (for example Morrowind in its key binding page)
      */
     MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
 }




More information about the wine-cvs mailing list