From e388a86c9d2968a162ace54c5eeaf4a897d22dae Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 25 Jul 2022 14:22:32 +0200 Subject: [PATCH] move floating windows manually on moveworkspacetomonitor --- src/Compositor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index a9b27396..175cb66d 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1273,8 +1273,14 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, SMonitor* pMoni pWorkspace->moveToMonitor(pMonitor->ID); for (auto& w : m_vWindows) { - if (w->m_iWorkspaceID == pWorkspace->m_iID) + if (w->m_iWorkspaceID == pWorkspace->m_iID) { w->m_iMonitorID = pMonitor->ID; + + // additionally, move floating windows manually + if (w->m_bIsFloating && w->m_bIsMapped && !w->m_bHidden) { + w->m_vRealPosition = w->m_vRealPosition.vec() - POLDMON->vecPosition + pMonitor->vecPosition; + } + } } if (SWITCHINGISACTIVE) { // if it was active, preserve its' status. If it wasn't, don't.