From 37e1450a4d028d974a7d38742a7bc5b093efa263 Mon Sep 17 00:00:00 2001 From: Darksome Date: Sat, 20 Aug 2022 13:25:56 +0300 Subject: Impl CCompositor::moveWindowToWorkspace --- src/layout/IHyprLayout.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/layout/IHyprLayout.cpp') diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 173668bc..f641ebc1 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -206,15 +206,7 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { if (PMONITOR) { DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID; - - if (DRAGGINGWINDOW->m_iWorkspaceID != PMONITOR->activeWorkspace) { - DRAGGINGWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace; - - auto PWORKSPACE = g_pCompositor->getWorkspaceByID(DRAGGINGWINDOW->m_iWorkspaceID); - if (PWORKSPACE) { - g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", DRAGGINGWINDOW, PWORKSPACE->m_szName.c_str())}); - } - } + g_pCompositor->moveWindowToWorkspace(DRAGGINGWINDOW, PMONITOR->activeWorkspace); DRAGGINGWINDOW->updateToplevel(); } @@ -239,7 +231,7 @@ void IHyprLayout::changeWindowFloatingMode(CWindow* pWindow) { if (!TILED) { const auto PNEWMON = g_pCompositor->getMonitorFromVector(pWindow->m_vRealPosition.vec() + pWindow->m_vRealSize.vec() / 2.f); pWindow->m_iMonitorID = PNEWMON->ID; - pWindow->m_iWorkspaceID = PNEWMON->activeWorkspace; + g_pCompositor->moveWindowToWorkspace(pWindow, PNEWMON->activeWorkspace); // save real pos cuz the func applies the default 5,5 mid const auto PSAVEDPOS = pWindow->m_vRealPosition.vec(); -- cgit v1.2.3