diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index 64f1788b8..84c2db81b 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -178,7 +178,8 @@ ProcXIWarpPointer(ClientPtr client) if (pSprite->hotShape) ConfineToShape(pSprite->hotShape, &x, &y); - (*newScreen->SetCursorPosition) (pDev, newScreen, x, y, TRUE); + if (newScreen->SetCursorPosition) + newScreen->SetCursorPosition(pDev, newScreen, x, y, TRUE); } else if (!PointerConfinedToScreen(pDev)) { NewCurrentScreen(pDev, newScreen, x, y); diff --git a/dix/events.c b/dix/events.c index 8a45327ef..a257dd284 100644 --- a/dix/events.c +++ b/dix/events.c @@ -558,7 +558,9 @@ XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) x -= pScreen->x; y -= pScreen->y; - return (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); + if (pScreen->SetCursorPosition) + return pScreen->SetCursorPosition(pDev, pScreen, x, y, generateEvent); + return TRUE; } static void @@ -776,8 +778,8 @@ CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor, Bool generateEvents, { if (pScreen != pSprite->hotPhys.pScreen) pSprite->hotPhys = new; - (*pScreen->SetCursorPosition) - (pDev, pScreen, new.x, new.y, generateEvents); + if (pScreen && pScreen->SetCursorPosition) + pScreen->SetCursorPosition(pDev, pScreen, new.x, new.y, generateEvents); } if (!generateEvents) SyntheticMotion(pDev, new.x, new.y); diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index e2c498966..9f48e2c15 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -330,7 +330,8 @@ xf86RandRSetConfig(ScreenPtr pScreen, view_adjusted = TRUE; } - (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); + if (pScreen->SetCursorPosition) + pScreen->SetCursorPosition(dev, pScreen, px, py, FALSE); } } diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 898e89ba2..439296f5a 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -2393,7 +2393,9 @@ DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y) py = pScrn->frameY0; if (py > pScrn->frameY1) py = pScrn->frameY1; - pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE); + + if (pScreen->SetCursorPosition) + pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE); return; }