Added dynamic monitor rules

This commit is contained in:
vaxerski
2022-04-19 19:01:23 +02:00
parent 1eec8c3741
commit 08ee14b4a0
7 changed files with 116 additions and 53 deletions

View File

@@ -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;
}