Up to once every 2s.
This fixes a regression from c2c78a2fe0ac13e4fca7ab4c17977b65e358485c, which caused severe FPS drop in Samurai Shodown.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51282 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/rawinput.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index 2660874d12c..f3dc4ae67de 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -418,7 +418,8 @@ BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_ms */ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_count, UINT size) { - UINT i; + static UINT last_check; + UINT i, ticks = GetTickCount();
TRACE("devices %p, device_count %p, size %u.\n", devices, device_count, size);
@@ -434,7 +435,11 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun return ~0U; }
- rawinput_update_device_list(); + if (ticks - last_check > 2000) + { + last_check = ticks; + rawinput_update_device_list(); + }
if (!devices) {