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

dinput: Stop sending WM_WINE_NOTIFY_ACTIVITY on every input.

This message triggers screensaver notification in the user drivers, but it is not useful to send it on every input message, and it even hurts performance when high polling mouse is used. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33643 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46976Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f2e886a0
......@@ -931,13 +931,19 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq)
{
static ULONGLONG notify_ms = 0;
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
int next_pos, ofs = id_to_offset(&This->data_format, inst_id);
ULONGLONG time_ms = GetTickCount64();
/* Event is being set regardless of the queue state */
if (This->hEvent) SetEvent(This->hEvent);
PostMessageW(GetDesktopWindow(), WM_WINE_NOTIFY_ACTIVITY, 0, 0);
if (time_ms - notify_ms > 1000)
{
PostMessageW(GetDesktopWindow(), WM_WINE_NOTIFY_ACTIVITY, 0, 0);
notify_ms = time_ms;
}
if (!This->queue_len || This->overflow || ofs < 0) return;
......
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