diff options
| author | Darksome <dev@darkso.me> | 2022-08-20 13:25:56 +0300 |
|---|---|---|
| committer | Darksome <dev@darkso.me> | 2022-08-20 13:25:56 +0300 |
| commit | 37e1450a4d028d974a7d38742a7bc5b093efa263 (patch) | |
| tree | 4ef1e953be25874de902d0accd3c550ee5b80c45 /src/Compositor.cpp | |
| parent | 844c33c9801177adf65ea7ed163a8a6df36a9a37 (diff) | |
Impl CCompositor::moveWindowToWorkspace
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 5d6d65ec..f345e300 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -876,6 +876,20 @@ void CCompositor::moveWindowToTop(CWindow* pWindow) { } } +void CCompositor::moveWindowToWorkspace(CWindow* pWindow, int workspaceID) { + if (!windowValidMapped(pWindow)) + return; + + if (pWindow->m_iWorkspaceID != workspaceID) { + pWindow->m_iWorkspaceID = workspaceID; + + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); + if (PWORKSPACE) { + g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", pWindow, PWORKSPACE->m_szName.c_str())}); + } + } +} + void CCompositor::cleanupFadingOut(const int& monid) { for (auto& w : m_vWindowsFadingOut) { |
