summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorMightyPlaza <123664421+MightyPlaza@users.noreply.github.com>2023-07-03 10:49:56 +0000
committerGitHub <noreply@github.com>2023-07-03 12:49:56 +0200
commit05047f60f4a6303a26f5ecef712f249b770f27b9 (patch)
tree10cca6c3f8f095be53d162ddafa64d0401530026 /src/managers/KeybindManager.cpp
parent738ec900f4d5c5e2b00f90e71221ca380555b874 (diff)
groupbar fixes (#2630)
Fixes multiple groupbar decoration issues: - togglegroup removes fullscreen to avoid to avoid weird state - fixes issue where a group had multiple windows with head = true - fixes issue where merging 2 groups would cause a window to have 2 groupbar decorations - fixes issue where merging a group with more than 1 window into another group would make windows have no groupbar decoration - fixes issue where ungrouping windows could just move them into another group on the same workspace --------- Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 52a18d2b..097b881c 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1174,6 +1174,8 @@ void CKeybindManager::toggleGroup(std::string args) {
if (!PWINDOW)
return;
+ g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL);
+
if (!PWINDOW->m_sGroupData.pNextWindow) {
PWINDOW->m_sGroupData.pNextWindow = PWINDOW;
PWINDOW->m_sGroupData.head = true;
@@ -1205,10 +1207,12 @@ void CKeybindManager::toggleGroup(std::string args) {
w->m_sGroupData.head = false;
}
+ g_pKeybindManager->m_bGroupsLocked = true;
for (auto& w : members) {
g_pLayoutManager->getCurrentLayout()->onWindowCreated(w);
w->updateWindowDecos();
}
+ g_pKeybindManager->m_bGroupsLocked = false;
}
}
@@ -2027,14 +2031,19 @@ void CKeybindManager::moveIntoGroup(std::string args) {
if (!PWINDOWINDIR || !PWINDOWINDIR->m_sGroupData.pNextWindow)
return;
- g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
+ if (!PWINDOW->m_sGroupData.pNextWindow)
+ PWINDOW->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(PWINDOW));
- PWINDOWINDIR->insertWindowToGroup(PWINDOW);
+ g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW); // This removes groupped property!
- PWINDOW->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(PWINDOW));
+ PWINDOW->m_sGroupData.locked = false;
+ PWINDOW->m_sGroupData.head = false;
+ PWINDOWINDIR->insertWindowToGroup(PWINDOW);
+ PWINDOWINDIR->setGroupCurrent(PWINDOW);
PWINDOW->updateWindowDecos();
g_pLayoutManager->getCurrentLayout()->recalculateWindow(PWINDOW);
+ g_pCompositor->focusWindow(PWINDOW);
}
void CKeybindManager::moveOutOfGroup(std::string args) {