From df746a73410b892a4d41a2934cf9cd2e8ad7ba51 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 19 Dec 2012 18:42:39 +0100 Subject: [PATCH] render: Unwrap early on the animated cursor BlockHandler The loop above the previous call may end up triggering other handlers attaching to the same function slot, so unwrapping the handler after that could leave the just attached handler in a dangling but not unset state. This issue was most visible on the XO, where destroying a window with an animated cursor set and running would trigger this inconsistent state, never calling the miSpriteBlockHandler again after the animated cursor is unset. Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- render/animcur.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/render/animcur.c b/render/animcur.c index ebc5b8ef7..9cbba83fa 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -143,6 +143,8 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen, Bool activeDevice = FALSE; CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ + Unwrap(as, pScreen, BlockHandler); + for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { if (!activeDevice) { @@ -180,7 +182,6 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen, if (activeDevice) AdjustWaitForDelay(pTimeout, soonest - now); - Unwrap(as, pScreen, BlockHandler); (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (activeDevice) Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);