diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index eef98622..ef312abd 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -735,7 +735,7 @@ void CHyprDwindleLayout::toggleWindowGroup(CWindow* pWindow) { } } -void CHyprDwindleLayout::switchGroupWindow(CWindow* pWindow) { +void CHyprDwindleLayout::switchGroupWindow(CWindow* pWindow, bool forward) { if (!g_pCompositor->windowValidMapped(pWindow)) return; // reject @@ -747,7 +747,13 @@ void CHyprDwindleLayout::switchGroupWindow(CWindow* pWindow) { if (!PNODE->pGroupParent) return; // reject - PNODE->pGroupParent->groupMemberActive++; + if (forward) + PNODE->pGroupParent->groupMemberActive++; + else + PNODE->pGroupParent->groupMemberActive--; + + if (PNODE->pGroupParent->groupMemberActive < 0) + PNODE->pGroupParent->groupMemberActive = PNODE->pGroupParent->groupMembers.size() - 1; if ((long unsigned int)PNODE->pGroupParent->groupMemberActive >= PNODE->pGroupParent->groupMembers.size()) PNODE->pGroupParent->groupMemberActive = 0; @@ -847,8 +853,10 @@ void CHyprDwindleLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) { void CHyprDwindleLayout::layoutMessage(SLayoutMessageHeader header, std::string message) { if (message == "togglegroup") toggleWindowGroup(header.pWindow); - else if (message == "changegroupactive") - switchGroupWindow(header.pWindow); + else if (message == "changegroupactivef") + switchGroupWindow(header.pWindow, true); + else if (message == "changegroupactiveb") + switchGroupWindow(header.pWindow, false); else if (message == "togglesplit") toggleSplit(header.pWindow); } diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index 5513e0f8..91d3a820 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -71,7 +71,7 @@ public: SDwindleNodeData* getMasterNodeOnWorkspace(const int&); void toggleWindowGroup(CWindow*); - void switchGroupWindow(CWindow*); + void switchGroupWindow(CWindow*, bool forward); void toggleSplit(CWindow*); friend struct SDwindleNodeData; diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index bd225c63..f37c853f 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -503,7 +503,10 @@ void CKeybindManager::toggleGroup(std::string args) { void CKeybindManager::changeGroupActive(std::string args) { SLayoutMessageHeader header; header.pWindow = g_pCompositor->m_pLastWindow; - g_pLayoutManager->getCurrentLayout()->layoutMessage(header, "changegroupactive"); + if (args == "b") + g_pLayoutManager->getCurrentLayout()->layoutMessage(header, "changegroupactiveb"); + else + g_pLayoutManager->getCurrentLayout()->layoutMessage(header, "changegroupactivef"); } void CKeybindManager::toggleSplit(std::string args) { diff --git a/v0.1.1beta.tar.gz b/v0.1.1beta.tar.gz new file mode 100644 index 00000000..30436448 Binary files /dev/null and b/v0.1.1beta.tar.gz differ