diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index b92a3d9d119..b4af12f142e 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -836,6 +836,8 @@ void CWindow::createGroup() { g_pCompositor->updateWorkspaceSpecialRenderData(workspaceID()); g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m_iMonitorID); g_pCompositor->updateAllWindowsAnimatedDecorationValues(); + + g_pEventManager->postEvent(SHyprIPCEvent{"togglegroup", std::format("1,{:x}", (uintptr_t)this)}); } } @@ -852,9 +854,12 @@ void CWindow::destroyGroup() { g_pCompositor->updateWorkspaceSpecialRenderData(workspaceID()); g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m_iMonitorID); g_pCompositor->updateAllWindowsAnimatedDecorationValues(); + + g_pEventManager->postEvent(SHyprIPCEvent{"togglegroup", std::format("0,{:x}", (uintptr_t)this)}); return; } + std::string addresses; PHLWINDOW curr = m_pSelf.lock(); std::vector members; do { @@ -863,6 +868,8 @@ void CWindow::destroyGroup() { PLASTWIN->m_sGroupData.pNextWindow.reset(); curr->setHidden(false); members.push_back(curr); + + addresses += std::format("{:x},", (uintptr_t)curr.get()); } while (curr.get() != this); for (auto& w : members) { @@ -883,6 +890,10 @@ void CWindow::destroyGroup() { g_pCompositor->updateWorkspaceSpecialRenderData(workspaceID()); g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m_iMonitorID); g_pCompositor->updateAllWindowsAnimatedDecorationValues(); + + if (!addresses.empty()) + addresses.pop_back(); + g_pEventManager->postEvent(SHyprIPCEvent{"togglegroup", std::format("0,{}", addresses)}); } PHLWINDOW CWindow::getGroupHead() { diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 6eadfd99b27..ca162884492 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -2238,6 +2238,8 @@ void CKeybindManager::moveWindowIntoGroup(PHLWINDOW pWindow, PHLWINDOW pWindowIn if (!pWindow->getDecorationByType(DECORATION_GROUPBAR)) pWindow->addWindowDeco(std::make_unique(pWindow)); + + g_pEventManager->postEvent(SHyprIPCEvent{"moveintogroup", std::format("{:x}", (uintptr_t)pWindow.get())}); } void CKeybindManager::moveWindowOutOfGroup(PHLWINDOW pWindow, const std::string& dir) { @@ -2275,6 +2277,8 @@ void CKeybindManager::moveWindowOutOfGroup(PHLWINDOW pWindow, const std::string& g_pCompositor->focusWindow(PWINDOWPREV); g_pCompositor->warpCursorTo(PWINDOWPREV->middle()); } + + g_pEventManager->postEvent(SHyprIPCEvent{"moveoutofgroup", std::format("{:x}", (uintptr_t)pWindow.get())}); } void CKeybindManager::moveIntoGroup(std::string args) {