Add API to update setting of waitForUpdate screen private in miPointer
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
69b2b5c85e
commit
3d9079b898
|
@ -245,8 +245,6 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
|
||||||
ScreenPtr pScreen = screenInfo.screens[index];
|
ScreenPtr pScreen = screenInfo.screens[index];
|
||||||
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, xf86CursorScreenKey);
|
&pScreen->devPrivates, xf86CursorScreenKey);
|
||||||
miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
|
|
||||||
&pScreen->devPrivates, miPointerScreenKey);
|
|
||||||
|
|
||||||
if (ScreenPriv->isUp) {
|
if (ScreenPriv->isUp) {
|
||||||
xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
|
xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
|
||||||
|
@ -261,7 +259,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
|
||||||
* ensure the cursor is repainted by miPointerWarpCursor().
|
* ensure the cursor is repainted by miPointerWarpCursor().
|
||||||
*/
|
*/
|
||||||
ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor;
|
ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor;
|
||||||
PointPriv->waitForUpdate = FALSE; /* Force cursor repaint */
|
miPointerSetWaitForUpdate(pScreen, FALSE); /* Force cursor repaint */
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -302,9 +300,6 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
||||||
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, xf86CursorScreenKey);
|
&pScreen->devPrivates, xf86CursorScreenKey);
|
||||||
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
|
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
|
||||||
miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
|
|
||||||
&pScreen->devPrivates, miPointerScreenKey);
|
|
||||||
|
|
||||||
|
|
||||||
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
|
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
|
||||||
if (ScreenPriv->SWCursor ||
|
if (ScreenPriv->SWCursor ||
|
||||||
|
@ -355,11 +350,12 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
||||||
xf86SetCursor(pScreen, pCurs, x, y);
|
xf86SetCursor(pScreen, pCurs, x, y);
|
||||||
ScreenPriv->SWCursor = FALSE;
|
ScreenPriv->SWCursor = FALSE;
|
||||||
ScreenPriv->isUp = TRUE;
|
ScreenPriv->isUp = TRUE;
|
||||||
PointPriv->waitForUpdate = !infoPtr->pScrn->silkenMouse;
|
|
||||||
|
miPointerSetWaitForUpdate(pScreen, !infoPtr->pScrn->silkenMouse);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointPriv->waitForUpdate = TRUE;
|
miPointerSetWaitForUpdate(pScreen, TRUE);
|
||||||
|
|
||||||
if (ScreenPriv->isUp) {
|
if (ScreenPriv->isUp) {
|
||||||
/* Remove the HW cursor, or make it transparent */
|
/* Remove the HW cursor, or make it transparent */
|
||||||
|
|
|
@ -452,6 +452,22 @@ miPointerGetScreen(DeviceIntPtr pDev)
|
||||||
return (pPointer) ? pPointer->pScreen : NULL;
|
return (pPointer) ? pPointer->pScreen : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Controls whether the cursor image should be updated immediately when
|
||||||
|
moved (FALSE) or if something else will be responsible for updating
|
||||||
|
it later (TRUE). Returns current setting.
|
||||||
|
Caller is responsible for calling OsBlockSignal first.
|
||||||
|
*/
|
||||||
|
Bool
|
||||||
|
miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait)
|
||||||
|
{
|
||||||
|
SetupScreen(pScreen);
|
||||||
|
Bool prevWait = pScreenPriv->waitForUpdate;
|
||||||
|
|
||||||
|
pScreenPriv->waitForUpdate = wait;
|
||||||
|
return prevWait;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Move the pointer on the current screen, and update the sprite. */
|
/* Move the pointer on the current screen, and update the sprite. */
|
||||||
static void
|
static void
|
||||||
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
|
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
|
|
@ -139,6 +139,11 @@ extern _X_EXPORT void miPointerSetPosition(
|
||||||
extern _X_EXPORT void miPointerUpdateSprite(
|
extern _X_EXPORT void miPointerUpdateSprite(
|
||||||
DeviceIntPtr pDev);
|
DeviceIntPtr pDev);
|
||||||
|
|
||||||
|
/* Sets whether the sprite should be updated immediately on pointer moves */
|
||||||
|
extern _X_EXPORT Bool miPointerSetWaitForUpdate(
|
||||||
|
ScreenPtr pScreen,
|
||||||
|
Bool wait);
|
||||||
|
|
||||||
extern _X_EXPORT DevPrivateKeyRec miPointerPrivKeyRec;
|
extern _X_EXPORT DevPrivateKeyRec miPointerPrivKeyRec;
|
||||||
#define miPointerPrivKey (&miPointerPrivKeyRec)
|
#define miPointerPrivKey (&miPointerPrivKeyRec)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue