diff options
| author | VPavliashvili <v_pavliashvili@yahoo.com> | 2024-05-07 15:00:55 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-07 12:00:55 +0100 |
| commit | 375e77e398b3d69ca90ed58420b929523576c6ef (patch) | |
| tree | 4c5192cfa9a80065fcd228ad5502221b9b588013 /src/desktop/Window.cpp | |
| parent | 96365309de49b5641e61b0028199382dcc25f8b2 (diff) | |
ipc: add togglegroup, moveintogroup and moveoutofgroup events (#5866)
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index b92a3d9d..b4af12f1 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<PHLWINDOW> 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() { |
