Commit 69eb8789 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez

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
parent 1694b24f
......@@ -220,6 +220,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();
......
......@@ -98,6 +98,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