workspacerules: fix workspace rule loops (#5433)

This commit is contained in:
thejch
2024-04-05 08:54:30 -07:00
committed by GitHub
parent 942172d2dc
commit 1e8f57c734
7 changed files with 68 additions and 91 deletions

View File

@@ -28,11 +28,9 @@ void CWorkspace::init(PHLWORKSPACE self) {
m_vRenderOffset.registerVar();
m_fAlpha.registerVar();
const auto RULESFORTHIS = g_pConfigManager->getWorkspaceRulesFor(self);
for (auto& rule : RULESFORTHIS) {
if (rule.defaultName.has_value())
m_szName = rule.defaultName.value();
}
const auto RULEFORTHIS = g_pConfigManager->getWorkspaceRuleFor(self);
if (RULEFORTHIS.defaultName.has_value())
m_szName = RULEFORTHIS.defaultName.value();
m_pFocusedWindowHook = g_pHookSystem->hookDynamic("closeWindow", [this](void* self, SCallbackInfo& info, std::any param) {
const auto PWINDOW = std::any_cast<CWindow*>(param);