[PATCH v2 2/3] winex11.drv: Wake up the display on user input.

Zebediah Figura z.figura12 at gmail.com
Mon Jul 2 17:04:48 CDT 2018


From: Zebediah Figura <zfigura at codeweavers.com>

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/winex11.drv/desktop.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index 4df8784..535fc53 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -167,6 +167,22 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
 }
 
 
+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 );
+}
+
 /***********************************************************************
  *		X11DRV_create_desktop
  *
@@ -181,6 +197,9 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height )
 
     TRACE( "%u x %u\n", width, height );
 
+    desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( GetDesktopWindow(), GWLP_WNDPROC,
+                                                       (LONG_PTR)desktop_wndproc_wrapper );
+
     /* Create window */
     win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | EnterWindowMask |
                           PointerMotionMask | ButtonPressMask | ButtonReleaseMask | FocusChangeMask;
-- 
2.7.4




More information about the wine-devel mailing list