diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-08 21:52:52 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-08 21:52:52 +0200 |
| commit | e6872bddf4c78ebaddbc3de2aa073afc948faf6b (patch) | |
| tree | b20ea6a047084ccf7c8568c2c950020afbddf8c1 /src | |
| parent | a7a3c0fc1d7087e3b1b51167a6c985b14cf04e82 (diff) | |
fix minor issues with floating windows and fullscreen
Diffstat (limited to 'src')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 14 | ||||
| -rw-r--r-- | src/managers/KeybindManager.cpp | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 73771e41..9f258b44 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -212,9 +212,23 @@ void IHyprLayout::changeWindowFloatingMode(CWindow* pWindow) { // fix pseudo leaving artifacts g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID)); } else { + pWindow->m_vSize = pWindow->m_vRealSize.vec(); + pWindow->m_vPosition = pWindow->m_vRealPosition.vec(); + onWindowRemovedTiling(pWindow); g_pCompositor->moveWindowToTop(pWindow); + + const auto POS = pWindow->m_vRealPosition.goalv(); + const auto SIZ = pWindow->m_vRealSize.goalv(); + + pWindow->m_vRealPosition.setValueAndWarp(POS + Vector2D(5, 5)); + pWindow->m_vRealSize.setValueAndWarp(SIZ - Vector2D(10, 10)); + + pWindow->m_vRealPosition = POS; + pWindow->m_vRealSize = SIZ; + + g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID)); } } diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 9fed911b..13bdf1e4 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -253,9 +253,6 @@ void CKeybindManager::toggleActiveFloating(std::string args) { moveActiveToWorkspace(std::to_string(g_pCompositor->getMonitorFromID(ACTIVEWINDOW->m_iMonitorID)->activeWorkspace)); } - ACTIVEWINDOW->m_vRealPosition.setValue(ACTIVEWINDOW->m_vRealPosition.vec() + Vector2D(5, 5)); - ACTIVEWINDOW->m_vSize = ACTIVEWINDOW->m_vRealPosition.vec() - Vector2D(10, 10); - g_pLayoutManager->getCurrentLayout()->changeWindowFloatingMode(ACTIVEWINDOW); } } |
