diff options
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Helper.c')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Helper.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index 8c948cf6f..fb56a0b17 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -1577,7 +1577,7 @@ xf86SetBackingStore(ScreenPtr pScreen) { Bool useBS = FALSE; MessageType from = X_DEFAULT; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); OptionInfoPtr options; options = xnfalloc(sizeof(BSOptions)); @@ -1618,7 +1618,7 @@ xf86SetSilkenMouse(ScreenPtr pScreen) { Bool useSM = TRUE; MessageType from = X_DEFAULT; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); OptionInfoPtr options; options = xnfalloc(sizeof(SMOptions)); @@ -1834,3 +1834,17 @@ xf86MotionHistoryAllocate(InputInfoPtr pInfo) { AllocateMotionHistory(pInfo->dev); } + +ScrnInfoPtr +xf86ScreenToScrn(ScreenPtr pScreen) +{ + assert(pScreen->myNum < xf86NumScreens); + return xf86Screens[pScreen->myNum]; +} + +ScreenPtr +xf86ScrnToScreen(ScrnInfoPtr pScrn) +{ + assert(pScrn->scrnIndex < screenInfo.numScreens); + return screenInfo.screens[pScrn->scrnIndex]; +} |