summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-13 15:25:42 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-13 15:25:42 +0200
commite9f226797e43cedf17b094bc498272213ed53687 (patch)
tree9a1a49cf308dac971a5bd73e4a00175930d323de /src/config/ConfigManager.cpp
parent7d4f0a319943f56b1a277ceae198fc3f77615afe (diff)
Added monitor mirroring
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 96a8f4da..7df288fe 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -493,11 +493,16 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
nextItem();
- if (curitem != "") {
- // warning for old cfg
- Debug::log(ERR, "Error in parsing rule for %s, possibly old config!", newrule.name.c_str());
- parseError = "Error in setting monitor rule. Are you using the old syntax? Confront the wiki.";
- return;
+ while (curitem != "") {
+ if (curitem == "mirror") {
+ nextItem();
+ newrule.mirrorOf = curitem;
+ nextItem();
+ } else {
+ Debug::log(ERR, "Config error: invalid monitor syntax");
+ parseError = "invalid syntax at \"" + curitem + "\"";
+ return;
+ }
}
if (std::find_if(m_dMonitorRules.begin(), m_dMonitorRules.end(), [&](const auto& other) { return other.name == newrule.name; }) != m_dMonitorRules.end())
@@ -1444,6 +1449,10 @@ void CConfigManager::performMonitorReload() {
for (auto& m : g_pCompositor->m_vRealMonitors) {
auto rule = getMonitorRuleFor(m->szName);
+
+ // ensure mirror
+ m->setMirror(rule.mirrorOf);
+
if (!g_pHyprRenderer->applyMonitorRule(m.get(), &rule)) {
overAgain = true;
break;