From 462781b16f9763cbfd8f182b8680b00c823ecd9e Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 3 Apr 2022 13:49:21 +0200 Subject: Added drag to move window --- src/layout/DwindleLayout.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index ce1e2a3f..5e4be345 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -324,12 +324,25 @@ void CHyprDwindleLayout::onBeginDragWindow() { return; } + if (!DRAGGINGWINDOW->m_bIsFloating) { + DRAGGINGWINDOW->m_bDraggingTiled = true; + changeWindowFloatingMode(DRAGGINGWINDOW); + } else { + DRAGGINGWINDOW->m_bDraggingTiled = false; + } m_vBeginDragXY = g_pInputManager->getMouseCoordsInternal(); m_vBeginDragPositionXY = DRAGGINGWINDOW->m_vRealPosition; m_vBeginDragSizeXY = DRAGGINGWINDOW->m_vRealSize; } +void CHyprDwindleLayout::onEndDragWindow() { + const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow; + + if (DRAGGINGWINDOW->m_bDraggingTiled) + changeWindowFloatingMode(DRAGGINGWINDOW); +} + void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow; -- cgit v1.2.3