From b60790d23e0777d38754e9040ba1a2b6477fec4d Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 13 Dec 2012 17:18:28 +0100
Subject: [PATCH 2/2] 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 <carlosg@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
|
b
|
AnimCurScreenBlockHandler(ScreenPtr pScreen, |
143 | 143 | Bool activeDevice = FALSE; |
144 | 144 | CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ |
145 | 145 | |
| 146 | Unwrap(as, pScreen, BlockHandler); |
| 147 | |
146 | 148 | for (dev = inputInfo.devices; dev; dev = dev->next) { |
147 | 149 | if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { |
148 | 150 | if (!activeDevice) { |
… |
… |
AnimCurScreenBlockHandler(ScreenPtr pScreen, |
180 | 182 | if (activeDevice) |
181 | 183 | AdjustWaitForDelay(pTimeout, soonest - now); |
182 | 184 | |
183 | | Unwrap(as, pScreen, BlockHandler); |
184 | 185 | (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); |
185 | 186 | if (activeDevice) |
186 | 187 | Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); |