Ticket #10695: 0001-libmythui-Fix-a-redraw-bug-in-MythUIType.patch

File 0001-libmythui-Fix-a-redraw-bug-in-MythUIType.patch, 2.1 KB (added by Lawrence Rust <lvr@…>, 8 years ago)
  • mythtv/libs/libmythui/mythuitype.cpp

    From d55d189f62d6ecfe74aaca3b9332ebea99323b74 Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Sun, 6 May 2012 12:33:35 +0200
    Subject: [PATCH] libmythui: Fix a redraw bug in MythUIType
    
    While evaluating the ATI Catalyst 'TearFree Desktop' option I noticed
    that sometimes a keypress was apparently being held up until the time
    on the main menu was updated.  Initially I thought that this was a lirc
    or fglrx issue, but on investigation it turned out that MythMainWindow::animate
    was requesting updates for empty repaint regions.  Delving further
    showed that MythUIType::Draw was resetting m_DirtyRegion to empty
    even if the clipRect was smaller, thus leaving unpainted regions.
    
    m_DirtyRegion may be extended by HandleMovementPulse, SetRedraw
    or SetChildNeedsRedraw etc AFTER GetDirtyArea is called.
    So when MythUIType::Draw is called, clipRect may not include the whole
    of m_DirtyRegion.
    
    This patch subtracts the Draw clipRect from m_DirtyRegion instead of
    simply emtying it.
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     mythtv/libs/libmythui/mythuitype.cpp |    7 +++++--
     1 files changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/mythtv/libs/libmythui/mythuitype.cpp b/mythtv/libs/libmythui/mythuitype.cpp
    index 5341e4b..ebd5235 100644
    a b void MythUIType::DrawSelf(MythPainter *, int, int, int, QRect) 
    478478void MythUIType::Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod,
    479479                      QRect clipRect)
    480480{
    481     m_DirtyRegion = QRegion(QRect(0, 0, 0, 0));
     481    // NB m_DirtyRegion may be extended by HandleMovementPulse, SetRedraw
     482    // or SetChildNeedsRedraw etc _AFTER_ GetDirtyArea is called.
     483    // So clipRect may not include the whole of m_DirtyRegion
     484    m_DirtyRegion -= QRegion(clipRect); // NB Qt >= 4.2
    482485
    483486    if (!m_Visible || m_Vanished)
    484487        return;
    void MythUIType::ConnectDependants(bool recurse) 
    14061409                (*it)->ConnectDependants(recurse);
    14071410        }
    14081411    }
    1409 }
    1410  No newline at end of file
     1412}