mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 20:29:48 +01:00
overwrite mon rule if exists
This commit is contained in:
parent
a0ec0326f9
commit
4b1773d1b1
1 changed files with 16 additions and 0 deletions
|
@ -159,6 +159,14 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
|||
if (curitem == "disable" || curitem == "disabled") {
|
||||
newrule.disabled = true;
|
||||
|
||||
// overwrite if exists
|
||||
for (auto& r : m_dMonitorRules) {
|
||||
if (r.name == newrule.name) {
|
||||
r = newrule;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_dMonitorRules.push_back(newrule);
|
||||
|
||||
return;
|
||||
|
@ -183,6 +191,14 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
|||
|
||||
newrule.scale = stof(curitem);
|
||||
|
||||
// overwrite if exists
|
||||
for (auto& r : m_dMonitorRules) {
|
||||
if (r.name == newrule.name) {
|
||||
r = newrule;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_dMonitorRules.push_back(newrule);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue