[PATCH 2/2] render: Unwrap early on the animated cursor BlockHandler

carlosg at gnome.org carlosg at gnome.org
Wed Dec 19 09:42:39 PST 2012


From: Carlos Garnacho <carlosg at gnome.org>

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 <carlosg at gnome.org>
---
 render/animcur.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/render/animcur.c b/render/animcur.c
index ebc5b8e..9cbba83 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);
-- 
1.8.0.1



More information about the xorg-devel mailing list