mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-25 00:31:39 +03:00
overwrite mon rule if exists
This commit is contained in:
parent
a0ec0326f9
commit
4b1773d1b1
@ -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 New Issue
Block a user