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
parent
405a0360fb
commit
191bef73ac
|
@ -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()
|
||||
|
|
1
logind.h
1
logind.h
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue