mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 04:31:57 -07:00
overwrite mon rule if exists
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user