Skip to content

Commit

Permalink
libmythui: Fix a redraw bug in MythUIType
Browse files Browse the repository at this point in the history
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.

Fixes #10695

Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information
Lawrence Rust authored and stuartm committed Oct 8, 2012
1 parent 9059a4e commit 39984eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mythtv/libs/libmythui/mythuitype.cpp
Expand Up @@ -478,7 +478,10 @@ void MythUIType::DrawSelf(MythPainter *, int, int, int, QRect)
void MythUIType::Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod,
QRect clipRect)
{
m_DirtyRegion = QRegion(QRect(0, 0, 0, 0));
// NB m_DirtyRegion may be extended by HandleMovementPulse, SetRedraw
// or SetChildNeedsRedraw etc _AFTER_ GetDirtyArea is called.
// So clipRect may not include the whole of m_DirtyRegion
m_DirtyRegion -= QRegion(clipRect); // NB Qt >= 4.2

if (!m_Visible || m_Vanished)
return;
Expand Down Expand Up @@ -1406,4 +1409,4 @@ void MythUIType::ConnectDependants(bool recurse)
(*it)->ConnectDependants(recurse);
}
}
}
}

0 comments on commit 39984eb

Please sign in to comment.