diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-30 23:55:28 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-30 23:55:28 +0200 |
| commit | 91d68513de5b182103393ee4abd3eb37db905bee (patch) | |
| tree | bd9d0be2061e01fc9be5f92a207b7ca446572b9b /src/managers/KeybindManager.cpp | |
| parent | 3970b43ea2de4e397ac548e6e148749bbe202ce2 (diff) | |
fix possible segfault by realloc
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index e2a26781..f5554f57 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -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) { |
