Rémi Bernon : winebus.sys: Request haptics effect to stop when only when needed.
Alexandre Julliard
julliard at winehq.org
Mon Feb 14 15:41:31 CST 2022
Module: wine
Branch: master
Commit: bcc113a7fd05bf85d93af6699f6dce4e158ae87b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=bcc113a7fd05bf85d93af6699f6dce4e158ae87b
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Mon Feb 14 17:26:17 2022 +0100
winebus.sys: Request haptics effect to stop when only when needed.
Instead of stopping them, then re-starting them when a new effect is
requested.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winebus.sys/bus_sdl.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index d036ec2b98e..eda37e42c2c 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -416,12 +416,15 @@ NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
effect.leftright.large_magnitude = rumble_intensity;
effect.leftright.small_magnitude = buzz_intensity;
- if (impl->effect_support & WINE_SDL_JOYSTICK_RUMBLE)
- pSDL_JoystickRumble(impl->sdl_joystick, 0, 0, 0);
- else if (impl->sdl_haptic)
- pSDL_HapticStopAll(impl->sdl_haptic);
if (!effect.leftright.large_magnitude && !effect.leftright.small_magnitude)
+ {
+ if (impl->effect_support & WINE_SDL_JOYSTICK_RUMBLE)
+ pSDL_JoystickRumble(impl->sdl_joystick, 0, 0, 0);
+ else if (impl->sdl_haptic)
+ pSDL_HapticStopAll(impl->sdl_haptic);
+
return STATUS_SUCCESS;
+ }
if (impl->effect_support & SDL_HAPTIC_LEFTRIGHT)
{
More information about the wine-cvs
mailing list