diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-27 12:11:45 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-27 12:11:45 +0000 |
| commit | 49063f949df92ab60244ff9e08025172bc512a8d (patch) | |
| tree | 5a6d9b950442b87a7319083a2da660a48a8bf3a0 /src/layout/IHyprLayout.cpp | |
| parent | 7699d657d91a3f54e0c4a6980fcb79abda0ebd4e (diff) | |
find floating windows below closed one
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index dfccacda..f16342a0 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -380,8 +380,17 @@ CWindow* IHyprLayout::getNextWindowCandidate(CWindow* pWindow) { return g_pCompositor->getFullscreenWindowOnWorkspace(pWindow->m_iWorkspaceID); if (pWindow->m_bIsFloating) { - // the window was floating, let's try the last tiled window. + // find whether there is a floating window below this one + for (auto& w : g_pCompositor->m_vWindows) { + if (w->m_bIsMapped && !w->isHidden() && w->m_bIsFloating && w->m_iX11Type != 2 && w->m_iWorkspaceID == pWindow->m_iWorkspaceID && !w->m_bX11ShouldntFocus && !w->m_bNoFocus) { + if (VECINRECT((pWindow->m_vSize / 2.f + pWindow->m_vPosition), w->m_vPosition.x, w->m_vPosition.y, w->m_vPosition.x + w->m_vSize.x, w->m_vPosition.y + w->m_vSize.y)) { + return w.get(); + } + } + } + + // let's try the last tiled window. if (m_pLastTiledWindow && m_pLastTiledWindow->m_iWorkspaceID == pWindow->m_iWorkspaceID) return m_pLastTiledWindow; |
