Ticket #4068: 0002-render-Unwrap-early-on-the-animated-cursor-BlockHand.patch

File 0002-render-Unwrap-early-on-the-animated-cursor-BlockHand.patch, 1.6 KB (added by garnacho, 11 years ago)

second patch, fixes pointer disappearing issues

  • render/animcur.c

    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, 
    143143    Bool activeDevice = FALSE;
    144144    CARD32 now = 0, soonest = ~0;       /* earliest time to wakeup again */
    145145
     146    Unwrap(as, pScreen, BlockHandler);
     147
    146148    for (dev = inputInfo.devices; dev; dev = dev->next) {
    147149        if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) {
    148150            if (!activeDevice) {
    AnimCurScreenBlockHandler(ScreenPtr pScreen, 
    180182    if (activeDevice)
    181183        AdjustWaitForDelay(pTimeout, soonest - now);
    182184
    183     Unwrap(as, pScreen, BlockHandler);
    184185    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
    185186    if (activeDevice)
    186187        Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);