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

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


From: Zebediah Figura <zfigura at codeweavers.com>

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/winemac.drv/window.c         | 24 ++++++++++++++++++++++++
 dlls/winemac.drv/winemac.drv.spec |  3 +++
 2 files changed, 27 insertions(+)

diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 48b44a6..fea5877 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -2831,3 +2831,27 @@ BOOL query_min_max_info(HWND hwnd)
     sync_window_min_max_info(hwnd);
     return TRUE;
 }
+
+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:
+    {
+        static IOPMAssertionID assertion;
+        IOPMAssertionDeclareUserActivity(CFSTR("Wine user input"), kIOPMUserActiveLocal, &assertion);
+        break;
+    }
+    }
+    return desktop_orig_wndproc( hwnd, msg, wp, lp );
+}
+
+BOOL macdrv_create_desktop( UINT width, UINT height )
+{
+    desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW(GetDesktopWindow(), GWLP_WNDPROC,
+                                                      (LONG_PTR)desktop_wndproc_wrapper);
+}
diff --git a/dlls/winemac.drv/winemac.drv.spec b/dlls/winemac.drv/winemac.drv.spec
index 6fa723a..c0ffe69 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_create_desktop(long long) macdrv_create_desktop
+
 # System tray
 @ cdecl wine_notify_icon(long ptr)
 
-- 
2.7.4




More information about the wine-devel mailing list