Module: wine Branch: master Commit: f5bf3630db8bf275bdf136ac2ea3c85cb4612992 URL: https://source.winehq.org/git/wine.git/?a=commit;h=f5bf3630db8bf275bdf136ac2... Author: Tim Schumacher <timschumi(a)gmx.de> Date: Sun May 19 00:43:17 2019 +0200 joy.cpl: Fix high CPU load in FF test window. If no effects are in the effects list, the loop in ff_input_thread is immediately restarted, skipping the poll interval. This causes an incredibly high refresh rate, which maxes out at least one CPU core. Signed-off-by: Tim Schumacher <timschumi(a)gmx.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/joy.cpl/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 3c75a78..06084f3 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -678,6 +678,8 @@ static DWORD WINAPI ff_input_thread(void *param) DWORD flags = DIEP_AXES | DIEP_DIRECTION | DIEP_NORESTART; RECT r; + Sleep(TEST_POLL_TIME); + /* Skip this if we have no effects */ if (joy->num_effects == 0 || chosen_effect < 0) continue; @@ -702,8 +704,6 @@ static DWORD WINAPI ff_input_thread(void *param) IDirectInputEffect_Start(joy->effects[chosen_effect].effect, 1, 0); break; } - - Sleep(TEST_POLL_TIME); } return 0;