Added moveoutofgroup dispatcher

This commit is contained in:
vaxerski 2023-02-26 13:55:35 +00:00
parent 55b412e0f4
commit 18ed73f091
2 changed files with 19 additions and 0 deletions

View file

@ -62,6 +62,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["focuscurrentorlast"] = focusCurrentOrLast;
m_mDispatchers["lockgroups"] = lockGroups;
m_mDispatchers["moveintogroup"] = moveIntoGroup;
m_mDispatchers["moveoutofgroup"] = moveOutOfGroup;
m_tScrollTimer.reset();
}
@ -2080,3 +2081,20 @@ void CKeybindManager::moveIntoGroup(std::string args) {
PWINDOWINDIR->insertWindowToGroup(PWINDOW);
}
void CKeybindManager::moveOutOfGroup(std::string args) {
const auto PWINDOW = g_pCompositor->m_pLastWindow;
if (!PWINDOW || !PWINDOW->m_sGroupData.pNextWindow)
return;
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
const auto GROUPSLOCKEDPREV = g_pKeybindManager->m_bGroupsLocked;
g_pKeybindManager->m_bGroupsLocked = true;
g_pLayoutManager->getCurrentLayout()->onWindowCreated(PWINDOW);
g_pKeybindManager->m_bGroupsLocked = GROUPSLOCKEDPREV;
}

View file

@ -137,6 +137,7 @@ class CKeybindManager {
static void bringActiveToTop(std::string);
static void lockGroups(std::string);
static void moveIntoGroup(std::string);
static void moveOutOfGroup(std::string);
friend class CCompositor;
friend class CInputManager;