Changeset View
Changeset View
Standalone View
Standalone View
kded/daemon.cpp
| Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 216 | case KScreen::OsdAction::Clone: | |||
|---|---|---|---|---|---|
| 219 | return; | 219 | return; | ||
| 220 | } | 220 | } | ||
| 221 | 221 | | |||
| 222 | Q_UNREACHABLE(); | 222 | Q_UNREACHABLE(); | ||
| 223 | } | 223 | } | ||
| 224 | 224 | | |||
| 225 | void KScreenDaemon::applyIdealConfig() | 225 | void KScreenDaemon::applyIdealConfig() | ||
| 226 | { | 226 | { | ||
| 227 | | ||||
| 228 | if (m_monitoredConfig->connectedOutputs().count() < 2) { | 227 | if (m_monitoredConfig->connectedOutputs().count() < 2) { | ||
| 229 | m_osdManager->hideOsd(); | 228 | m_osdManager->hideOsd(); | ||
| 230 | doApplyConfig(Generator::self()->idealConfig(m_monitoredConfig)); | 229 | doApplyConfig(Generator::self()->idealConfig(m_monitoredConfig)); | ||
| 231 | } else { | 230 | } else { | ||
| 232 | qCDebug(KSCREEN_KDED) << "Getting ideal config from user via OSD..."; | 231 | qCDebug(KSCREEN_KDED) << "Getting ideal config from user via OSD..."; | ||
| 233 | auto action = m_osdManager->showActionSelector(); | 232 | auto action = m_osdManager->showActionSelector(); | ||
| 234 | connect(action, &KScreen::OsdAction::selected, | 233 | connect(action, &KScreen::OsdAction::selected, | ||
| 235 | this, &KScreenDaemon::applyOsdAction); | 234 | this, &KScreenDaemon::applyOsdAction); | ||
| Show All 13 Lines | |||||
| 249 | void KScreenDaemon::configChanged() | 248 | void KScreenDaemon::configChanged() | ||
| 250 | { | 249 | { | ||
| 251 | qCDebug(KSCREEN_KDED) << "Change detected"; | 250 | qCDebug(KSCREEN_KDED) << "Change detected"; | ||
| 252 | logConfig(m_monitoredConfig); | 251 | logConfig(m_monitoredConfig); | ||
| 253 | 252 | | |||
| 254 | // Modes may have changed, fix-up current mode id | 253 | // Modes may have changed, fix-up current mode id | ||
| 255 | bool changed = false; | 254 | bool changed = false; | ||
| 256 | Q_FOREACH(const KScreen::OutputPtr &output, m_monitoredConfig->outputs()) { | 255 | Q_FOREACH(const KScreen::OutputPtr &output, m_monitoredConfig->outputs()) { | ||
| 257 | if (output->isConnected() && output->isEnabled() && output->currentMode().isNull()) { | 256 | if (output->isConnected() && output->isEnabled() && (output->currentMode().isNull() || (output->followPreferredMode() && output->currentModeId() != output->preferredModeId()))) { | ||
| 258 | qCDebug(KSCREEN_KDED) << "Current mode" << output->currentModeId() << "invalid, setting preferred mode" << output->preferredModeId(); | 257 | qCDebug(KSCREEN_KDED) << "Current mode was" << output->currentModeId() << ", setting preferred mode" << output->preferredModeId(); | ||
| 259 | output->setCurrentModeId(output->preferredModeId()); | 258 | output->setCurrentModeId(output->preferredModeId()); | ||
| 260 | changed = true; | 259 | changed = true; | ||
| 261 | } | 260 | } | ||
| 262 | } | 261 | } | ||
| 263 | if (changed) { | 262 | if (changed) { | ||
| 264 | doApplyConfig(m_monitoredConfig); | 263 | doApplyConfig(m_monitoredConfig); | ||
| 265 | } | 264 | } | ||
| 266 | 265 | | |||
| ▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines | |||||