drm: Make sure the screens are turned on when we come from suspend

Listen to logind for resume notification and turn the outputs on when it
happens, much like we do when pressing a key.

This way laptops come back on when the lid opens.

BUG: 428424


(cherry picked from commit 69eb8789ba)
icc-effect-5.20.5
Aleix Pol 2020-11-02 01:28:36 +00:00 committed by Nate Graham
parent 405a0360fb
commit 191bef73ac
3 changed files with 13 additions and 0 deletions

View File

@ -221,6 +221,13 @@ void LogindIntegration::logindServiceRegistered()
emit connectedChanged();
}
);
m_bus.connect(m_sessionControllerService,
m_sessionPath,
m_sessionControllerManagerInterface,
QStringLiteral("PrepareForSleep"),
this,
SIGNAL(prepareForSleep(bool)));
}
void LogindIntegration::connectSessionPropertiesChanged()

View File

@ -54,6 +54,7 @@ Q_SIGNALS:
void hasSessionControlChanged(bool);
void sessionActiveChanged(bool);
void virtualTerminalChanged(int);
void prepareForSleep(bool prepare);
private Q_SLOTS:
void getSessionActive();

View File

@ -106,6 +106,11 @@ void DrmBackend::init()
} else {
connect(logind, &LogindIntegration::connectedChanged, this, takeControl);
}
connect(logind, &LogindIntegration::prepareForSleep, this, [this] (bool active) {
if (!active) {
turnOutputsOn();
}
});
}
void DrmBackend::prepareShutdown()