From f76b9c485246849bc3af838503fedbadf68023f5 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 23 Jun 2022 20:39:48 +0200 Subject: fix: ignore reserved in getWindowInDirection --- src/Compositor.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 1861e5aa..be94c093 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -770,8 +770,11 @@ void CCompositor::cleanupFadingOut() { } CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { - const auto POSA = pWindow->m_vPosition; - const auto SIZEA = pWindow->m_vSize; + + const auto WINDOWIDEALBB = pWindow->getWindowIdealBoundingBoxIgnoreReserved(); + + const auto POSA = Vector2D(WINDOWIDEALBB.x, WINDOWIDEALBB.y); + const auto SIZEA = Vector2D(WINDOWIDEALBB.width, WINDOWIDEALBB.height); auto longestIntersect = -1; CWindow* longestIntersectWindow = nullptr; @@ -780,8 +783,11 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { if (&w == pWindow || !windowValidMapped(&w) || w.m_bIsFloating || !isWorkspaceVisible(w.m_iWorkspaceID)) continue; - const auto POSB = w.m_vPosition; - const auto SIZEB = w.m_vSize; + const auto BWINDOWIDEALBB = w.getWindowIdealBoundingBoxIgnoreReserved(); + + const auto POSB = Vector2D(BWINDOWIDEALBB.x, BWINDOWIDEALBB.y); + const auto SIZEB = Vector2D(BWINDOWIDEALBB.width, BWINDOWIDEALBB.height); + switch (dir) { case 'l': if (STICKS(POSA.x, POSB.x + SIZEB.x)) { -- cgit v1.2.3