Skip to content

Commit

Permalink
Improve logic for (re)creating painters
Browse files Browse the repository at this point in the history
  • Loading branch information
ulmus-scott committed Aug 27, 2021
1 parent a2cdb90 commit 0421486
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
17 changes: 4 additions & 13 deletions mythtv/libs/libmythui/mythmainwindow.cpp
Expand Up @@ -715,21 +715,13 @@ void MythMainWindow::Init(bool MayReInit)

move(m_screenRect.topLeft());

if (m_painterWin)
{
m_oldPainterWin = m_painterWin;
m_painterWin = nullptr;
}

if (m_painter)
if (m_painterWin || m_painter)
{
m_oldPainter = m_painter;
m_painter = nullptr;
LOG(VB_GENERAL, LOG_INFO, "Destroying painter and painter window");
MythPainterWindow::DestroyPainters(m_painterWin, m_painter);
}

QString warningmsg;
if (!m_painter && !m_painterWin)
warningmsg = MythPainterWindow::CreatePainters(this, m_painterWin, m_painter);
QString warningmsg = MythPainterWindow::CreatePainters(this, m_painterWin, m_painter);

if (!m_painterWin)
{
Expand Down Expand Up @@ -958,7 +950,6 @@ void MythMainWindow::ReloadKeys()

void MythMainWindow::ReinitDone()
{
MythPainterWindow::DestroyPainters(m_oldPainterWin, m_oldPainter);
ShowPainterWindow();
MoveResize(m_screenRect);
}
Expand Down
2 changes: 0 additions & 2 deletions mythtv/libs/libmythui/mythmainwindow.h
Expand Up @@ -166,9 +166,7 @@ class MUI_PUBLIC MythMainWindow : public MythUIScreenBounds
QTimer m_refreshTimer;
MythThemeBase* m_themeBase { nullptr };
MythPainter* m_painter { nullptr };
MythPainter* m_oldPainter { nullptr };
MythPainterWindow* m_painterWin { nullptr };
MythPainterWindow* m_oldPainterWin { nullptr };
MythInputDeviceHandler* m_deviceHandler { nullptr };
MythScreenSaverControl* m_screensaver { nullptr };
QTimer m_idleTimer;
Expand Down

0 comments on commit 0421486

Please sign in to comment.