diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 5ec8842794d..36b9fe9d3aa 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -68,6 +68,7 @@ static int primary_crtc; static struct x11drv_mode_info *dd_modes; static SizeID *xrandr10_modes; static unsigned int xrandr_mode_count; +static int xrandr_current_mode = -1; static int load_xrandr(void) { @@ -125,6 +126,9 @@ static int xrandr10_get_current_mode(void) unsigned int i; int res = -1; + if (xrandr_current_mode != -1) + return xrandr_current_mode; + sc = pXRRGetScreenInfo (gdi_display, DefaultRootWindow( gdi_display )); size = pXRRConfigCurrentConfiguration (sc, &rot); rate = pXRRConfigCurrentRate (sc); @@ -141,8 +145,10 @@ static int xrandr10_get_current_mode(void) if (res == -1) { ERR("In unknown mode, returning default\n"); - res = 0; + return 0; } + + xrandr_current_mode = res; return res; } @@ -177,6 +183,7 @@ static LONG xrandr10_set_current_mode( int mode ) if (stat == RRSetConfigSuccess) { + xrandr_current_mode = mode; X11DRV_resize_desktop( dd_modes[mode].width, dd_modes[mode].height ); return DISP_CHANGE_SUCCESSFUL; }