diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-04 19:41:55 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-04 19:41:55 +0200 |
| commit | 9742ac7596b83025c7ab0cf4e92d9db347b4b5c3 (patch) | |
| tree | 6a66053d15bcc62c00a9ce96730f3e6b15b0abe3 /src/managers/KeybindManager.cpp | |
| parent | beef23cee5cdc47142da50bf029f52bdff192025 (diff) | |
attempt to fix a specialworkspace crash
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index d26b0e92..061f60a9 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -890,11 +890,16 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) { } } } else { + auto PSPECIALWORKSPACE = g_pCompositor->getWorkspaceByID(SPECIAL_WORKSPACE_ID); + + if (!PSPECIALWORKSPACE) { + // ??? happens sometimes...? + PSPECIALWORKSPACE = g_pCompositor->m_vWorkspaces.emplace_back(std::make_unique<CWorkspace>(g_pCompositor->m_pLastMonitor->ID, "special", true)).get(); + } + g_pCompositor->m_pLastMonitor->specialWorkspaceOpen = true; g_pLayoutManager->getCurrentLayout()->recalculateMonitor(g_pCompositor->m_pLastMonitor->ID); - const auto PSPECIALWORKSPACE = g_pCompositor->getWorkspaceByID(SPECIAL_WORKSPACE_ID); - PSPECIALWORKSPACE->startAnim(true, true); PSPECIALWORKSPACE->m_iMonitorID = g_pCompositor->m_pLastMonitor->ID; } |
