Jacek Caban : winex11: Get virtual screen rect from win32u.

Alexandre Julliard julliard at winehq.org
Fri Feb 18 15:15:00 CST 2022


Module: wine
Branch: master
Commit: 586f377b46b28c9693870b81b3f2a1cbb25c62e2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=586f377b46b28c9693870b81b3f2a1cbb25c62e2

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Feb 18 13:37:12 2022 +0100

winex11: Get virtual screen rect from win32u.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/win32u/sysparams.c    | 3 +++
 dlls/winex11.drv/display.c | 8 +-------
 include/ntuser.h           | 1 +
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index 7af1e20f008..09a04892d2d 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -4534,6 +4534,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
         return HandleToUlong( get_sys_color_pen(arg) );
     case NtUserGetSystemMetrics:
         return get_system_metrics( arg );
+    case NtUserGetVirtualScreenRect:
+        *(RECT *)arg = get_virtual_screen_rect( 0 );
+        return 1;
     case NtUserMessageBeep:
         return message_beep( arg );
     /* temporary exports */
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c
index 04380ff660f..bff14d3370c 100644
--- a/dlls/winex11.drv/display.c
+++ b/dlls/winex11.drv/display.c
@@ -54,7 +54,6 @@ struct x11drv_display_device_handler desktop_handler;
 
 /* Cached screen information, protected by screen_section */
 static HKEY video_key;
-static RECT virtual_screen_rect;
 static RECT primary_monitor_rect;
 static FILETIME last_query_screen_time;
 static CRITICAL_SECTION screen_section;
@@ -124,7 +123,6 @@ static BOOL update_screen_cache(void)
     }
 
     EnterCriticalSection(&screen_section);
-    virtual_screen_rect = virtual_rect;
     primary_monitor_rect = primary_rect;
     last_query_screen_time = filetime;
     LeaveCriticalSection(&screen_section);
@@ -160,11 +158,7 @@ POINT root_to_virtual_screen(INT x, INT y)
 RECT get_virtual_screen_rect(void)
 {
     RECT virtual;
-
-    update_screen_cache();
-    EnterCriticalSection(&screen_section);
-    virtual = virtual_screen_rect;
-    LeaveCriticalSection(&screen_section);
+    NtUserCallOneParam( (UINT_PTR)&virtual, NtUserGetVirtualScreenRect );
     return virtual;
 }
 
diff --git a/include/ntuser.h b/include/ntuser.h
index 51f1c624ba6..43c1880fc9b 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -79,6 +79,7 @@ enum
     NtUserGetSysColorBrush,
     NtUserGetSysColorPen,
     NtUserGetSystemMetrics,
+    NtUserGetVirtualScreenRect,
     NtUserMessageBeep,
     NtUserRealizePalette,
     /* temporary exports */




More information about the wine-cvs mailing list