xrandr: Small X11DRV_XRandR_(Get|Set)CurrentMode() code optimisations.
This commit is contained in:
parent
d99f9ab71a
commit
c255bf4676
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue