summaryrefslogtreecommitdiff
path: root/src/layout/MasterLayout.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-09-04 15:34:07 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-09-04 15:34:13 +0200
commit9f3a64481ecb277de6775efbb0f3d8d7648a610c (patch)
tree3cb4632d376e389cf2bfad882a71627e5ee95182 /src/layout/MasterLayout.cpp
parent69439871e60eeb16993fd6044843d14d2191c9fb (diff)
dwindle: add proper movement for window move binds
ditches the "movewindow = swapwindow" mechanism. Fixes #2804
Diffstat (limited to 'src/layout/MasterLayout.cpp')
-rw-r--r--src/layout/MasterLayout.cpp9
1 files changed, 9 insertions, 0 deletions
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