Commit 7347b442 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d0ff5e66
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment