Commit c255bf46 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

xrandr: Small X11DRV_XRandR_(Get|Set)CurrentMode() code optimisations.

parent d99f9ab7
......@@ -162,6 +162,8 @@ static int X11DRV_XRandR_GetCurrentMode(void)
sc = pXRRGetScreenInfo (gdi_display, root);
size = pXRRConfigCurrentConfiguration (sc, &rot);
rate = pXRRConfigCurrentRate (sc);
pXRRFreeScreenConfigInfo(sc);
wine_tsx11_unlock();
for (i = 0; i < real_xrandr_modes_count; i++)
{
if ( (dd_modes[i].dwWidth == real_xrandr_sizes[size].width ) &&
......@@ -169,10 +171,9 @@ static int X11DRV_XRandR_GetCurrentMode(void)
(dd_modes[i].wRefreshRate == rate ) )
{
res = i;
break;
}
}
pXRRFreeScreenConfigInfo(sc);
wine_tsx11_unlock();
if (res == -1)
{
ERR("In unknown mode, returning default\n");
......@@ -226,6 +227,7 @@ static void X11DRV_XRandR_SetCurrentMode(int mode)
dd_modes[mode].dwWidth, dd_modes[mode].dwHeight, rate);
stat = pXRRSetScreenConfigAndRate (gdi_display, sc, root,
size, rot, rate, CurrentTime);
break;
}
}
}
......@@ -235,6 +237,7 @@ static void X11DRV_XRandR_SetCurrentMode(int mode)
dd_modes[mode].dwWidth, dd_modes[mode].dwHeight);
stat = pXRRSetScreenConfig (gdi_display, sc, root, size, rot, CurrentTime);
}
break;
}
}
pXRRFreeScreenConfigInfo(sc);
......
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