mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 06:01:56 -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") {
|
if (curitem == "disable" || curitem == "disabled") {
|
||||||
newrule.disabled = true;
|
newrule.disabled = true;
|
||||||
|
|
||||||
|
// overwrite if exists
|
||||||
|
for (auto& r : m_dMonitorRules) {
|
||||||
|
if (r.name == newrule.name) {
|
||||||
|
r = newrule;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_dMonitorRules.push_back(newrule);
|
m_dMonitorRules.push_back(newrule);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -183,6 +191,14 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
|||||||
|
|
||||||
newrule.scale = stof(curitem);
|
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);
|
m_dMonitorRules.push_back(newrule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user