diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index f4e08abdf..74935ac2a 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -177,7 +177,8 @@ ProcXIWarpPointer(ClientPtr client) if (pSprite->hotShape) ConfineToShape(pDev, 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 217462d84..24996b372 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 1bd5f8ea7..607056a70 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; }