diff options
author | MightyPlaza <[email protected]> | 2023-10-08 12:49:15 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-10-08 13:49:15 +0100 |
commit | 499df49f7b28f9e3be9b1c53843fd5c465dec60b (patch) | |
tree | a33b3d47c7da359a3d60cfe38575ee3b7a5a9ce0 /src/managers | |
parent | 728a8bb48e0f7de1cbe1ad13fb469754c3d0bc97 (diff) | |
download | Hyprland-499df49f7b28f9e3be9b1c53843fd5c465dec60b.tar.gz Hyprland-499df49f7b28f9e3be9b1c53843fd5c465dec60b.zip |
dispatchers: fix extra monitor offset when snapping floating (#3520)
modified: src/managers/KeybindManager.cpp
Diffstat (limited to 'src/managers')
-rw-r--r-- | src/managers/KeybindManager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 1a7ebafc..c86804d6 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1109,20 +1109,20 @@ void CKeybindManager::moveActiveTo(std::string args) { return; if (PLASTWINDOW->m_bIsFloating) { - auto vPos = PLASTWINDOW->m_vRealPosition.goalv(); + Vector2D vPos; const auto PMONITOR = g_pCompositor->getMonitorFromID(PLASTWINDOW->m_iMonitorID); const auto BORDERSIZE = PLASTWINDOW->getRealBorderSize(); switch (arg) { - case 'l': vPos.x = PMONITOR->vecReservedTopLeft.x + BORDERSIZE; break; - case 'r': vPos.x = PMONITOR->vecSize.x - PMONITOR->vecReservedBottomRight.x - PLASTWINDOW->m_vRealSize.goalv().x - BORDERSIZE; break; + case 'l': vPos.x = PMONITOR->vecReservedTopLeft.x + BORDERSIZE + PMONITOR->vecPosition.x; break; + case 'r': vPos.x = PMONITOR->vecSize.x - PMONITOR->vecReservedBottomRight.x - PLASTWINDOW->m_vRealSize.goalv().x - BORDERSIZE + PMONITOR->vecPosition.x; break; case 't': - case 'u': vPos.y = PMONITOR->vecReservedTopLeft.y + BORDERSIZE; break; + case 'u': vPos.y = PMONITOR->vecReservedTopLeft.y + BORDERSIZE + PMONITOR->vecPosition.y; break; case 'b': - case 'd': vPos.y = PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PLASTWINDOW->m_vRealSize.goalv().y - BORDERSIZE; break; + case 'd': vPos.y = PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PLASTWINDOW->m_vRealSize.goalv().y - BORDERSIZE + PMONITOR->vecPosition.y; break; } - PLASTWINDOW->m_vRealPosition = vPos + PMONITOR->vecPosition; + PLASTWINDOW->m_vRealPosition = Vector2D(vPos.x != 0 ? vPos.x : PLASTWINDOW->m_vRealPosition.goalv().x, vPos.y != 0 ? vPos.y : PLASTWINDOW->m_vRealPosition.goalv().y); return; } |