Commit 191bef73 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Nate Graham
Browse files

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 69eb8789)
parent 405a0360
......@@ -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()
......
......@@ -54,6 +54,7 @@ Q_SIGNALS:
void hasSessionControlChanged(bool);
void sessionActiveChanged(bool);
void virtualTerminalChanged(int);
void prepareForSleep(bool prepare);
private Q_SLOTS:
void getSessionActive();
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment