diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-04-23 22:31:14 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-04-23 22:31:14 +0100 |
| commit | b06fbdb7431aa2b6653d788ad9fb758478c72d4c (patch) | |
| tree | fd75cd837a29c87262e4f80c605728ea8837f01a /src/layout/DwindleLayout.cpp | |
| parent | 241a4935a244f403fa7108259075b04c81ed258f (diff) | |
dwindle: use idealIgnoreReserved for moveWindowTo bbs
fixes #10005
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index ba4370e5..7e823f88 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -816,18 +816,20 @@ void CHyprDwindleLayout::moveWindowTo(PHLWINDOW pWindow, const std::string& dir, const auto originalWorkspaceID = pWindow->workspaceID(); const Vector2D originalPos = pWindow->middle(); - if (!PNODE) + if (!PNODE || !pWindow->m_pMonitor) return; - Vector2D focalPoint; + Vector2D focalPoint; + + const auto WINDOWIDEALBB = pWindow->isFullscreen() ? CBox{pWindow->m_pMonitor->vecPosition, pWindow->m_pMonitor->vecSize} : pWindow->getWindowIdealBoundingBoxIgnoreReserved(); switch (dir[0]) { case 't': - case 'u': focalPoint = pWindow->m_vPosition + Vector2D{pWindow->m_vSize.x / 2.0, -1.0}; break; + case 'u': focalPoint = WINDOWIDEALBB.pos() + Vector2D{WINDOWIDEALBB.size().x / 2.0, -1.0}; break; case 'd': - case 'b': focalPoint = pWindow->m_vPosition + Vector2D{pWindow->m_vSize.x / 2.0, pWindow->m_vSize.y + 1.0}; break; - case 'l': focalPoint = pWindow->m_vPosition + Vector2D{-1.0, pWindow->m_vSize.y / 2.0}; break; - case 'r': focalPoint = pWindow->m_vPosition + Vector2D{pWindow->m_vSize.x + 1.0, pWindow->m_vSize.y / 2.0}; break; + case 'b': focalPoint = WINDOWIDEALBB.pos() + Vector2D{WINDOWIDEALBB.size().x / 2.0, WINDOWIDEALBB.size().y + 1.0}; break; + case 'l': focalPoint = WINDOWIDEALBB.pos() + Vector2D{-1.0, WINDOWIDEALBB.size().y / 2.0}; break; + case 'r': focalPoint = WINDOWIDEALBB.pos() + Vector2D{WINDOWIDEALBB.size().x + 1.0, WINDOWIDEALBB.size().y / 2.0}; break; default: UNREACHABLE(); } |
