diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-12-16 20:07:44 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-12-16 20:07:44 +0000 |
| commit | deb8d3d82ebe4154b04bd97af847cf83c3ae1ce2 (patch) | |
| tree | 9b68f51ea27d5b3a3f5df65eba35ef348af0f1b0 /src/layout/IHyprLayout.cpp | |
| parent | f72c237d85f406f4a6a4ca181ee35399ca8c37bc (diff) | |
ignore self in candidate floating
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index bc7e7984..708fa717 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -396,7 +396,7 @@ CWindow* IHyprLayout::getNextWindowCandidate(CWindow* pWindow) { // 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) { + !w->m_bNoFocus && w.get() != pWindow) { 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(); @@ -409,13 +409,14 @@ CWindow* IHyprLayout::getNextWindowCandidate(CWindow* pWindow) { return m_pLastTiledWindow; // if we don't, let's try to find any window that is in the middle - if (const auto PWINDOWCANDIDATE = g_pCompositor->vectorToWindowIdeal(pWindow->m_vRealPosition.goalv() + pWindow->m_vRealSize.goalv() / 2.f); PWINDOWCANDIDATE) + if (const auto PWINDOWCANDIDATE = g_pCompositor->vectorToWindowIdeal(pWindow->m_vRealPosition.goalv() + pWindow->m_vRealSize.goalv() / 2.f); PWINDOWCANDIDATE && + PWINDOWCANDIDATE != pWindow) return PWINDOWCANDIDATE; // if not, floating window 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) + !w->m_bNoFocus && w.get() != pWindow) return w.get(); } |
