Skip to content

Commit 3104b1f

Browse files
jpharveystuartm
authored andcommitted
Spot UpdateRequest being called while drawing is disabled & call it when we re-enable. Patch slightly modified.
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
1 parent 9590973 commit 3104b1f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

mythtv/libs/libmythui/mythmainwindow.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ class MythMainWindowPrivate
177177

178178
m_themeBase(NULL),
179179

180-
m_udpListener(NULL)
180+
m_udpListener(NULL),
181+
182+
m_pendingUpdate(false)
181183
{
182184
}
183185

@@ -258,6 +260,8 @@ class MythMainWindowPrivate
258260

259261
MythThemeBase *m_themeBase;
260262
MythUDPListener *m_udpListener;
263+
264+
bool m_pendingUpdate;
261265
};
262266

263267
// Make keynum in QKeyEvent be equivalent to what's in QKeySequence
@@ -840,6 +844,9 @@ bool MythMainWindow::screenShot(void)
840844

841845
bool MythMainWindow::event(QEvent *e)
842846
{
847+
if (!updatesEnabled() && (e->type() == QEvent::UpdateRequest))
848+
d->m_pendingUpdate = true;
849+
843850
if (e->type() == QEvent::Show && !e->spontaneous())
844851
{
845852
QCoreApplication::postEvent(
@@ -1290,12 +1297,18 @@ void MythMainWindow::SetDrawEnabled(bool enable)
12901297

12911298
if (enable)
12921299
{
1293-
repaint(); // See #8952
1300+
if (d->m_pendingUpdate)
1301+
{
1302+
QApplication::postEvent(this, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
1303+
d->m_pendingUpdate = false;
1304+
}
12941305
d->drawTimer->start(1000 / 70);
1306+
12951307
}
12961308
else
12971309
d->drawTimer->stop();
12981310

1311+
12991312
d->m_setDrawEnabledWait.wakeAll();
13001313
}
13011314

0 commit comments

Comments
 (0)