Commit a80f7681 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

user32: Throttle device list updates from GetRawInputDeviceList.

Up to once every 2s. This fixes a regression from c2c78a2f, which caused severe FPS drop in Samurai Shodown. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51282Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6a30f12e
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment