outputconfigurationstore: ensure that the config doesn't turn off all outputs
This commit is contained in:
parent
75935c126c
commit
3c25474b41
1 changed files with 7 additions and 0 deletions
|
@ -735,6 +735,13 @@ void OutputConfigurationStore::load()
|
|||
if (fail || setup.outputs.empty()) {
|
||||
continue;
|
||||
}
|
||||
// one of the outputs must be enabled
|
||||
const bool noneEnabled = std::none_of(setup.outputs.begin(), setup.outputs.end(), [](const auto &output) {
|
||||
return output.enabled;
|
||||
});
|
||||
if (noneEnabled) {
|
||||
continue;
|
||||
}
|
||||
setup.lidClosed = data["lidClosed"].toBool(false);
|
||||
// there must be only one setup that refers to a given set of outputs
|
||||
const bool alreadyExists = std::any_of(m_setups.begin(), m_setups.end(), [&setup](const auto &other) {
|
||||
|
|
Loading…
Reference in a new issue