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

This commit is contained in:
Francois Gouget 2007-01-11 15:47:06 +01:00 committed by Alexandre Julliard
parent d99f9ab71a
commit c255bf4676
1 changed files with 5 additions and 2 deletions

View File

@ -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);