From c21881be252aaea61eb8d3f7192b4032f27f6f14 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 4 Apr 2022 16:25:30 +0200 Subject: Implement proper z-system --- src/layout/DwindleLayout.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 5e4be345..4e12fc49 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -304,6 +304,8 @@ void CHyprDwindleLayout::changeWindowFloatingMode(CWindow* pWindow) { pWindow->m_vRealSize = PSAVEDSIZE; } else { onWindowRemoved(pWindow); + + g_pCompositor->moveWindowToTop(pWindow); } } @@ -327,6 +329,7 @@ void CHyprDwindleLayout::onBeginDragWindow() { if (!DRAGGINGWINDOW->m_bIsFloating) { DRAGGINGWINDOW->m_bDraggingTiled = true; changeWindowFloatingMode(DRAGGINGWINDOW); + DRAGGINGWINDOW->m_bIsFloating = true; } else { DRAGGINGWINDOW->m_bDraggingTiled = false; } @@ -339,8 +342,11 @@ void CHyprDwindleLayout::onBeginDragWindow() { void CHyprDwindleLayout::onEndDragWindow() { const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow; - if (DRAGGINGWINDOW->m_bDraggingTiled) + if (DRAGGINGWINDOW->m_bDraggingTiled) { + DRAGGINGWINDOW->m_bIsFloating = false; changeWindowFloatingMode(DRAGGINGWINDOW); + } + } void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { @@ -419,6 +425,8 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize); g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); + + g_pCompositor->moveWindowToTop(pWindow); } void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { @@ -466,6 +474,8 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize); } + g_pCompositor->moveWindowToTop(pWindow); + // we need to fix XWayland windows by sending them to NARNIA // because otherwise they'd still be recieving mouse events g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); -- cgit v1.2.3