From: Zebediah Figura Subject: [PATCH 2/4] dinput: Notify the desktop window when device input is received. Message-Id: <1529625588-2810-2-git-send-email-zfigura@codeweavers.com> Date: Thu, 21 Jun 2018 18:59:46 -0500 In-Reply-To: <1529625588-2810-1-git-send-email-zfigura@codeweavers.com> References: <1529625588-2810-1-git-send-email-zfigura@codeweavers.com> Signed-off-by: Zebediah Figura --- The overall goal of this patchset is to avoid letting the system go to sleep when a joystick is being used. On Windows, receiving input from a joystick which is currently being read by dinput can be easily shown to reset the system idle timer. dlls/dinput/device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 7b83a39..fc43fb5 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -39,6 +39,8 @@ #include "device_private.h" #include "dinput_private.h" +#define WM_WINE_NOTIFY_ACTIVITY WM_USER + WINE_DEFAULT_DEBUG_CHANNEL(dinput); static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) @@ -968,6 +970,8 @@ void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD tim } } + SendMessageW(GetDesktopWindow(), WM_WINE_NOTIFY_ACTIVITY, 0, 0); + This->queue_head = next_pos; /* Send event if asked */ } -- 2.7.4