Zhiyi Zhang : winex11.drv: Get the minimum screen size from XRRGetScreenSizeRange().

Alexandre Julliard julliard at winehq.org
Tue Mar 31 16:44:23 CDT 2020


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Mon Mar 30 22:38:28 2020 +0800

winex11.drv: Get the minimum screen size from XRRGetScreenSizeRange().

RandR minimum screen size is not necessarily 0x0. Some drivers report
resolutions smaller than the minimum screen size. When Wine tries to
switch to these resolutions, a X error is generated and causes process
exit.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/xrandr.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index 930e0282be..bdfe3d42d9 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -60,6 +60,7 @@ MAKE_FUNCPTR(XRRFreeScreenResources)
 MAKE_FUNCPTR(XRRGetCrtcInfo)
 MAKE_FUNCPTR(XRRGetOutputInfo)
 MAKE_FUNCPTR(XRRGetScreenResources)
+MAKE_FUNCPTR(XRRGetScreenSizeRange)
 MAKE_FUNCPTR(XRRSetCrtcConfig)
 MAKE_FUNCPTR(XRRSetScreenSize)
 static typeof(XRRGetScreenResources) *pXRRGetScreenResourcesCurrent;
@@ -114,6 +115,7 @@ static int load_xrandr(void)
         LOAD_FUNCPTR(XRRGetCrtcInfo)
         LOAD_FUNCPTR(XRRGetOutputInfo)
         LOAD_FUNCPTR(XRRGetScreenResources)
+        LOAD_FUNCPTR(XRRGetScreenSizeRange)
         LOAD_FUNCPTR(XRRSetCrtcConfig)
         LOAD_FUNCPTR(XRRSetScreenSize)
         r = 2;
@@ -361,9 +363,13 @@ static int xrandr12_get_current_mode(void)
 
 static void get_screen_size( XRRScreenResources *resources, unsigned int *width, unsigned int *height )
 {
+    int min_width = 0, min_height = 0, max_width, max_height;
     XRRCrtcInfo *crtc_info;
     int i;
-    *width = *height = 0;
+
+    pXRRGetScreenSizeRange( gdi_display, root_window, &min_width, &min_height, &max_width, &max_height );
+    *width = min_width;
+    *height = min_height;
 
     for (i = 0; i < resources->ncrtc; ++i)
     {




More information about the wine-cvs mailing list