Module: wine Branch: master Commit: 3fc2bccac25c93f820afab53bddd5b228c169b67 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3fc2bccac25c93f820afab53bd...
Author: Sam Edwards CFSworks@gmail.com Date: Fri May 10 09:51:21 2013 -0600
winex11: Cache XRandR 1.0 display mode.
---
dlls/winex11.drv/xrandr.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 5ec8842..36b9fe9 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; }