summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-19 19:01:23 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-19 19:01:23 +0200
commit08ee14b4a0a93793f0f65295056889597ea8af56 (patch)
tree709cb33221c98bf29286299f52a0071ce8fcbdef /src/config/ConfigManager.cpp
parent1eec8c374151bdb74559749bb76fa732e41cb0ba (diff)
Added dynamic monitor rules
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 30585502..b2af4eea 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -396,6 +396,13 @@ void CConfigManager::loadConfigLoadVars() {
g_pHyprError->queueCreate("Warning: You're using an autogenerated config! (config file: " + CONFIGPATH + " )\nSUPER+Enter -> kitty\nSUPER+T -> Alacritty\nSUPER+M -> exit Hyprland", CColor(255, 255, 70, 255));
else
g_pHyprError->destroy();
+
+ // Set the modes for all monitors as we configured them
+ // not on first launch because monitors might not exist yet
+ // and they'll be taken care of in the newMonitor event
+ if (!isFirstLaunch) {
+ m_bWantsMonitorReload = true;
+ }
}
void CConfigManager::tick() {
@@ -526,4 +533,13 @@ void CConfigManager::dispatchExecOnce() {
}
firstExecRequests.clear(); // free some kb of memory :P
+}
+
+void CConfigManager::performMonitorReload() {
+ for (auto& m : g_pCompositor->m_lMonitors) {
+ auto rule = getMonitorRuleFor(m.szName);
+ g_pHyprRenderer->applyMonitorRule(&m, &rule);
+ }
+
+ m_bWantsMonitorReload = false;
} \ No newline at end of file