Fix the RandR failure path for rotated screens.

This commit is contained in:
Aaron Plattner 2006-07-20 18:19:07 -07:00
parent 22db3fdb54
commit eeaad0e956

View File

@ -156,6 +156,8 @@ xf86RandRSetMode (ScreenPtr pScreen,
int oldHeight = pScreen->height; int oldHeight = pScreen->height;
int oldmmWidth = pScreen->mmWidth; int oldmmWidth = pScreen->mmWidth;
int oldmmHeight = pScreen->mmHeight; int oldmmHeight = pScreen->mmHeight;
int oldVirtualX = scrp->virtualX;
int oldVirtualY = scrp->virtualY;
WindowPtr pRoot = WindowTable[pScreen->myNum]; WindowPtr pRoot = WindowTable[pScreen->myNum];
Bool ret = TRUE; Bool ret = TRUE;
@ -188,10 +190,12 @@ xf86RandRSetMode (ScreenPtr pScreen,
} }
if (!xf86SwitchMode (pScreen, mode)) if (!xf86SwitchMode (pScreen, mode))
{ {
scrp->virtualX = pScreen->width = oldWidth; pScreen->width = oldWidth;
scrp->virtualY = pScreen->height = oldHeight; pScreen->height = oldHeight;
pScreen->mmWidth = oldmmWidth; pScreen->mmWidth = oldmmWidth;
pScreen->mmHeight = oldmmHeight; pScreen->mmHeight = oldmmHeight;
scrp->virtualX = oldVirtualX;
scrp->virtualY = oldVirtualY;
ret = FALSE; ret = FALSE;
} }
/* /*
@ -270,8 +274,8 @@ xf86RandRSetConfig (ScreenPtr pScreen,
xorgRRRotation RRRotation; xorgRRRotation RRRotation;
RRRotation.RRConfig.rotation = oldRotation; RRRotation.RRConfig.rotation = oldRotation;
RRRotation.RRConfig.rate = xf86RandRModeRefresh (scrp->currentMode); RRRotation.RRConfig.rate = xf86RandRModeRefresh (scrp->currentMode);
RRRotation.RRConfig.width = pScreen->width; RRRotation.RRConfig.width = scrp->virtualX;
RRRotation.RRConfig.height = pScreen->height; RRRotation.RRConfig.height = scrp->virtualY;
(*scrp->DriverFunc)(scrp, RR_SET_CONFIG, &RRRotation); (*scrp->DriverFunc)(scrp, RR_SET_CONFIG, &RRRotation);
} }