fix possible segfault by realloc

This commit is contained in:
vaxerski
2022-06-30 23:55:28 +02:00
parent 3970b43ea2
commit 91d68513de
4 changed files with 27 additions and 8 deletions

View File

@@ -894,10 +894,18 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) {
}
void CKeybindManager::forceRendererReload(std::string args) {
bool overAgain = false;
for (auto& m : g_pCompositor->m_vMonitors) {
auto rule = g_pConfigManager->getMonitorRuleFor(m->szName);
g_pHyprRenderer->applyMonitorRule(m.get(), &rule, true);
if (!g_pHyprRenderer->applyMonitorRule(m.get(), &rule, true)) {
overAgain = true;
break;
}
}
if (overAgain)
forceRendererReload(args);
}
void CKeybindManager::resizeActive(std::string args) {