From 9f3a64481ecb277de6775efbb0f3d8d7648a610c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:34:07 +0200 Subject: dwindle: add proper movement for window move binds ditches the "movewindow = swapwindow" mechanism. Fixes #2804 --- src/layout/MasterLayout.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/layout/MasterLayout.cpp') diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index cae0f67a..b5a867d8 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -743,6 +743,15 @@ SWindowRenderLayoutHints CHyprMasterLayout::requestRenderHints(CWindow* pWindow) return hints; // master doesnt have any hints } +void CHyprMasterLayout::moveWindowTo(CWindow* pWindow, const std::string& dir) { + if (!isDirection(dir)) + return; + + const auto PWINDOW2 = g_pCompositor->getWindowInDirection(pWindow, dir[0]); + + switchWindows(pWindow, PWINDOW2); +} + void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) { // windows should be valid, insallah -- cgit v1.2.3