From c6b6935bb433dbbd30f5ba122a7c45ad3a2d6eed Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 4 Jul 2018 17:16:41 +0200 Subject: [PATCH] winex11.drv: Wake up the display on user input. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/winex11.drv/window.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a848dc61e14..24c9429ef4d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1804,6 +1804,22 @@ BOOL CDECL X11DRV_CreateDesktopWindow( HWND hwnd ) } +static WNDPROC desktop_orig_wndproc; + +#define WM_WINE_NOTIFY_ACTIVITY WM_USER + +static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) +{ + switch (msg) + { + case WM_WINE_NOTIFY_ACTIVITY: + XResetScreenSaver( gdi_display ); + XFlush( gdi_display ); + break; + } + return desktop_orig_wndproc( hwnd, msg, wp, lp ); +} + /********************************************************************** * CreateWindow (X11DRV.@) */ @@ -1814,6 +1830,9 @@ BOOL CDECL X11DRV_CreateWindow( HWND hwnd ) struct x11drv_thread_data *data = x11drv_init_thread_data(); XSetWindowAttributes attr; + desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( hwnd, GWLP_WNDPROC, + (LONG_PTR)desktop_wndproc_wrapper ); + /* create the cursor clipping window */ attr.override_redirect = TRUE; attr.event_mask = StructureNotifyMask | FocusChangeMask;