mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 00:45:58 +01:00
erase instead of overwriting monitor rules
This commit is contained in:
parent
36e563c79c
commit
871c81ac1a
1 changed files with 2 additions and 14 deletions
|
@ -433,13 +433,7 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// overwrite if exists
|
m_dMonitorRules.erase(std::remove_if(m_dMonitorRules.begin(), m_dMonitorRules.end(), [&](const auto& other) { return other.name == newrule.name; }));
|
||||||
for (auto& r : m_dMonitorRules) {
|
|
||||||
if (r.name == newrule.name) {
|
|
||||||
r = newrule;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_dMonitorRules.push_back(newrule);
|
m_dMonitorRules.push_back(newrule);
|
||||||
|
|
||||||
|
@ -474,13 +468,7 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// overwrite if exists
|
m_dMonitorRules.erase(std::remove_if(m_dMonitorRules.begin(), m_dMonitorRules.end(), [&](const auto& other) { return other.name == newrule.name; }));
|
||||||
for (auto& r : m_dMonitorRules) {
|
|
||||||
if (r.name == newrule.name) {
|
|
||||||
r = newrule;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_dMonitorRules.push_back(newrule);
|
m_dMonitorRules.push_back(newrule);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue