From a4edfbef022f9635c2c9b9eb229cb622834dc68c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 24 Nov 2007 16:16:48 +1030 Subject: [PATCH] mi: only call UpdateSpriteForScreen if the screen actually changed. If we call it unconditionally, we flip the dev->spriteInfo->sprite permanently when using XTestFakeInput (once in CheckMotion as called from the processInputProc, another time in UpdateSpriteForScreen when we actually warp the cursor). USFS also updates to the screen's root window unconditionally, which is not really what we want if we haven't changed screen at all. --- mi/mipointer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mi/mipointer.c b/mi/mipointer.c index b2f31c1d5..ff5882380 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -359,6 +359,7 @@ miPointerWarpCursor (pDev, pScreen, x, y) int x, y; { miPointerPtr pPointer; + BOOL changedScreen = FALSE; if (!pDev->isMaster && !pDev->u.master) return; @@ -366,7 +367,10 @@ miPointerWarpCursor (pDev, pScreen, x, y) SetupScreen (pScreen); if (pPointer->pScreen != pScreen) + { (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, TRUE); + changedScreen = TRUE; + } if (GenerateEvent) { @@ -387,7 +391,8 @@ miPointerWarpCursor (pDev, pScreen, x, y) pPointer->y = y; pPointer->pScreen = pScreen; } - UpdateSpriteForScreen (pDev, pScreen) ; + if (changedScreen) + UpdateSpriteForScreen (pDev, pScreen) ; } /*