diff --git a/kded/daemon.cpp b/kded/daemon.cpp --- a/kded/daemon.cpp +++ b/kded/daemon.cpp @@ -189,6 +189,15 @@ } m_changeBlockTimer->invalidate(); qCDebug(KSCREEN_KDED) << "Change detected"; + + // Modes may have changed, fix-up current mode id + Q_FOREACH(const KScreen::OutputPtr &output, m_monitoredConfig->outputs()) { + if (output->currentMode().isNull()) { + qCDebug(KSCREEN_KDED) << "Current mode invalid, fixing up mode id"; + output->setCurrentModeId(output->preferredModeId()); + } + } + // Reset timer, delay the writeback m_saveTimer->start(); } @@ -199,6 +208,7 @@ // We assume the config is valid, since it's what we got, but we are interested // in the "at least one enabled screen" check + const bool valid = KScreen::Config::canBeApplied(m_monitoredConfig, KScreen::Config::ValidityFlag::RequireAtLeastOneEnabledScreen); if (valid) { Serializer::saveConfig(m_monitoredConfig, Serializer::configId(m_monitoredConfig));