diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index f44e04e3..ebbcc805 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -928,7 +928,16 @@ void CHyprMasterLayout::moveWindowTo(CWindow* pWindow, const std::string& dir) { const auto PWINDOW2 = g_pCompositor->getWindowInDirection(pWindow, dir[0]); - switchWindows(pWindow, PWINDOW2); + if (pWindow->m_iWorkspaceID != PWINDOW2->m_iWorkspaceID) { + // if different monitors, send to monitor + onWindowRemovedTiling(pWindow); + pWindow->moveToWorkspace(PWINDOW2->m_iWorkspaceID); + pWindow->m_iMonitorID = PWINDOW2->m_iMonitorID; + onWindowCreatedTiling(pWindow); + } else { + // if same monitor, switch windows + switchWindows(pWindow, PWINDOW2); + } } void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {