diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-08-25 18:05:08 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-08-25 18:05:08 +0200 |
| commit | 870471dd96724474869d2e648b623c17df12fb57 (patch) | |
| tree | 62b34b8586bb14dab6f64991edf9969cff885caa /src/managers/KeybindManager.cpp | |
| parent | 23e17700a73324e7e0a5bccb96e426bbb99efe7b (diff) | |
internal: allow opening empty special workspaces
Fixes point 2 of #2596
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 9614774a..81a2aaf5 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1515,12 +1515,8 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) { return; } - if (g_pCompositor->getWindowsOnWorkspace(workspaceID) == 0) { - Debug::log(LOG, "Can't open empty special workspace!"); - return; - } - bool requestedWorkspaceIsAlreadyOpen = false; + bool requestedWorkspaceExists = g_pCompositor->getWorkspaceByID(workspaceID); const auto PMONITOR = *PFOLLOWMOUSE == 1 ? g_pCompositor->getMonitorFromCursor() : g_pCompositor->m_pLastMonitor; int specialOpenOnMonitor = PMONITOR->specialWorkspaceID; @@ -1566,10 +1562,8 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) { // not open anywhere auto PSPECIALWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceID); - if (!PSPECIALWORKSPACE) { - // ??? happens sometimes...? + if (!PSPECIALWORKSPACE) PSPECIALWORKSPACE = g_pCompositor->createNewWorkspace(workspaceID, PMONITOR->ID, workspaceName); - } PMONITOR->setSpecialWorkspace(PSPECIALWORKSPACE); } |
