diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index d7c3e1ec..b2e93216 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -122,13 +122,6 @@ void Events::listener_mapWindow(void* owner, void* data) { requestedWorkspace = WORKSPACERQ; } - if (requestedWorkspace == "special") { - requestedWorkspace = ""; - workspaceSilent = false; - Debug::log(LOG, "windowrule=workspace special is not allowed!"); - continue; - } - Debug::log(LOG, "Rule workspace matched by window %x, %s applied.", PWINDOW, r.szValue.c_str()); } else if (r.szRule.find("float") == 0) { PWINDOW->m_bIsFloating = true; @@ -177,6 +170,10 @@ void Events::listener_mapWindow(void* owner, void* data) { } requestedWorkspace = requestedWorkspace.substr(0, requestedWorkspace.find_first_of(' ')); + + if (requestedWorkspace == "special") { + workspaceSilent = true; + } } if (!workspaceSilent) { diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index d33cd0b6..7f9bb39a 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -898,7 +898,12 @@ 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(g_pCompositor->m_pLastMonitor->ID, "special", true)).get(); + } + g_pCompositor->m_pLastMonitor->specialWorkspaceOpen = true; g_pLayoutManager->getCurrentLayout()->recalculateMonitor(g_pCompositor->m_pLastMonitor->ID);