From 6fc504fc4cde0e5dcfcc0ce61de06b1d88fdf34f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 20 Mar 2022 11:22:55 +0100 Subject: fix various issues with floating windows --- src/layout/DwindleLayout.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/layout') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 2b69e2d9..129c2142 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -294,4 +294,13 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize); } + + // get middle point + Vector2D middle = DRAGGINGWINDOW->m_vRealPosition + DRAGGINGWINDOW->m_vRealSize / 2.f; + + // and check its monitor + const auto PMONITOR = g_pCompositor->getMonitorFromVector(middle); + + if (PMONITOR) + DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID; } \ No newline at end of file -- cgit v1.2.3