Merge branch 'Plasma/5.5'

This commit is contained in:
Martin Gräßlin 2015-11-23 11:49:35 +01:00
commit 6fa3c58951
2 changed files with 26 additions and 0 deletions

View file

@ -159,6 +159,28 @@ void HwcomposerBackend::init()
if (m_refreshRate != 0) {
m_vsyncInterval = 1000000/m_refreshRate;
}
if (m_lights) {
using namespace KWayland::Server;
output->setDpmsSupported(true);
auto updateDpms = [this, output] {
output->setDpmsMode(m_outputBlank ? OutputInterface::DpmsMode::Off : OutputInterface::DpmsMode::On);
};
updateDpms();
connect(this, &HwcomposerBackend::outputBlankChanged, this, updateDpms);
connect(output, &OutputInterface::dpmsModeRequested, this,
[this] (KWayland::Server::OutputInterface::DpmsMode mode) {
if (mode == OutputInterface::DpmsMode::On) {
if (m_outputBlank) {
toggleBlankOutput();
}
} else {
if (!m_outputBlank) {
toggleBlankOutput();
}
}
}
);
}
qCDebug(KWIN_HWCOMPOSER) << "Display size:" << m_displaySize;
qCDebug(KWIN_HWCOMPOSER) << "Refresh rate:" << m_refreshRate;
@ -202,6 +224,7 @@ void HwcomposerBackend::toggleBlankOutput()
compositor->addRepaintFull();
}
}
emit outputBlankChanged();
}
void HwcomposerBackend::toggleScreenBrightness()

View file

@ -74,6 +74,9 @@ public:
void waitVSync();
void wakeVSync();
Q_SIGNALS:
void outputBlankChanged();
private Q_SLOTS:
void toggleBlankOutput();