Ticket #13444: 20190415-android-suspend-fix.patch

File 20190415-android-suspend-fix.patch, 1.9 KB (added by mspieth, 8 months ago)
  • mythtv/libs/libmythui/mythmainwindow.cpp

    diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp
    index 7346643a5b..825a092b68 100644
    a b MythMainWindow::MythMainWindow(const bool useDB) 
    506506    connect(this, SIGNAL(signalSetDrawEnabled(bool)),
    507507            this, SLOT(SetDrawEnabled(bool)),
    508508            Qt::BlockingQueuedConnection);
     509#ifdef Q_OS_ANDROID
     510    connect(qApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)),
     511            this, SLOT(onApplicationStateChange(Qt::ApplicationState)));
     512#endif
    509513
    510514    // We need to listen for playback start/end events
    511515    gCoreContext->addListener(this);
    void MythMainWindow::DisableIdleTimer(bool disableIdle) 
    31463150        QMetaObject::invokeMethod(d->m_idleTimer, "start");
    31473151}
    31483152
     3153void MythMainWindow::onApplicationStateChange(Qt::ApplicationState state)
     3154{
     3155    LOG(VB_GENERAL, LOG_NOTICE, QString("Application State Changed to %1").arg(state));
     3156    switch (state)
     3157    {
     3158        case Qt::ApplicationState::ApplicationActive:
     3159            PopDrawDisabled();
     3160            break;
     3161        case Qt::ApplicationState::ApplicationSuspended:
     3162            PushDrawDisabled();
     3163            break;
     3164        default:
     3165            break;
     3166    }
     3167}
    31493168/* vim: set expandtab tabstop=4 shiftwidth=4: */
  • mythtv/libs/libmythui/mythmainwindow.h

    diff --git a/mythtv/libs/libmythui/mythmainwindow.h b/mythtv/libs/libmythui/mythmainwindow.h
    index 876b51ee19..650a220887 100644
    a b class MUI_PUBLIC MythMainWindow : public QWidget 
    150150    void animate();
    151151    void doRemoteScreenShot(QString filename, int x, int y);
    152152    void SetDrawEnabled(bool enable);
     153    void onApplicationStateChange(Qt::ApplicationState state);
    153154
    154155  signals:
    155156    void signalRemoteScreenShot(QString filename, int x, int y);