Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- programs/explorer/desktop.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index a2d9e1a..f5a01c2 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -46,6 +46,10 @@ static const WCHAR default_driver[] = {'m','a','c',',','x','1','1',0}; static const WCHAR default_driver[] = {'x','1','1',0}; #endif
+static void (CDECL *wine_notify_activity)(void); + +#define WM_WINE_NOTIFY_ACTIVITY WM_USER + static BOOL using_root;
struct launcher @@ -661,6 +665,11 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR } return 0;
+ case WM_WINE_NOTIFY_ACTIVITY: + if (wine_notify_activity) + wine_notify_activity(); + return 0; + default: return DefWindowProcW( hwnd, message, wp, lp ); } @@ -1005,6 +1014,8 @@ void manage_desktop( WCHAR *arg ) { pShellDDEInit( TRUE ); } + + wine_notify_activity = (void *)GetProcAddress( graphics_driver, "wine_notify_activity" ); } }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- 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 */ }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winex11.drv/winex11.drv.spec | 1 + dlls/winex11.drv/x11drv_main.c | 12 ++++++++++++ 2 files changed, 13 insertions(+)
diff --git a/dlls/winex11.drv/winex11.drv.spec b/dlls/winex11.drv/winex11.drv.spec index 614f0b9..c833edb 100644 --- a/dlls/winex11.drv/winex11.drv.spec +++ b/dlls/winex11.drv/winex11.drv.spec @@ -57,6 +57,7 @@
# Desktop @ cdecl wine_create_desktop(long long) X11DRV_create_desktop +@ cdecl wine_notify_activity() X11DRV_notify_activity
# System tray @ cdecl wine_notify_icon(long ptr) diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 4654556..0dbd4f6 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -739,3 +739,15 @@ BOOL CDECL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_p } return FALSE; /* let user32 handle it */ } + +/*********************************************************************** + * wine_notify_activity (X11DRV.@) + * + * Notify the display server that activity has occurred, e.g. to wake up + * the display and reset any power management related timeouts. + */ +void CDECL X11DRV_notify_activity(void) +{ + XResetScreenSaver( gdi_display ); + XFlush( gdi_display ); +}
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winemac.drv/macdrv_main.c | 12 ++++++++++++ dlls/winemac.drv/winemac.drv.spec | 3 +++ 2 files changed, 15 insertions(+)
diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 491ab06..1e76d94 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -451,3 +451,15 @@ BOOL CDECL macdrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_p } return FALSE; } + +/*********************************************************************** + * wine_notify_activity (X11DRV.@) + * + * Notify the display server that activity has occurred, e.g. to wake up + * the display and reset any power management related timeouts. + */ +void CDECL macdrv_notify_activity(void) +{ + static IOPMAssertionID assertion; + IOPMAssertionDeclareUserActivity("Wine user input", kIOPMUserActiveLocal, &assertion); +} diff --git a/dlls/winemac.drv/winemac.drv.spec b/dlls/winemac.drv/winemac.drv.spec index 6fa723a..9658fad 100644 --- a/dlls/winemac.drv/winemac.drv.spec +++ b/dlls/winemac.drv/winemac.drv.spec @@ -45,6 +45,9 @@ @ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) macdrv_WindowPosChanged @ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) macdrv_WindowPosChanging
+# Desktop +@ cdecl wine_notify_activity() macdrv_notify_activity + # System tray @ cdecl wine_notify_icon(long ptr)