mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 04:45:58 +01:00
layout: Focus a floating window after closing the last tiled (#4137)
This commit is contained in:
parent
934112af5b
commit
4de986072c
1 changed files with 10 additions and 4 deletions
|
@ -565,13 +565,19 @@ CWindow* IHyprLayout::getNextWindowCandidate(CWindow* pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it was a tiled window, we first try to find the window that will replace it.
|
// if it was a tiled window, we first try to find the window that will replace it.
|
||||||
const auto PWINDOWCANDIDATE = g_pCompositor->vectorToWindowIdeal(pWindow->middle());
|
auto pWindowCandidate = g_pCompositor->vectorToWindowIdeal(pWindow->middle());
|
||||||
|
|
||||||
if (!PWINDOWCANDIDATE || pWindow == PWINDOWCANDIDATE || !PWINDOWCANDIDATE->m_bIsMapped || PWINDOWCANDIDATE->isHidden() || PWINDOWCANDIDATE->m_bX11ShouldntFocus ||
|
if (!pWindowCandidate)
|
||||||
PWINDOWCANDIDATE->m_iX11Type == 2 || PWINDOWCANDIDATE->m_iMonitorID != g_pCompositor->m_pLastMonitor->ID)
|
pWindowCandidate = g_pCompositor->getTopLeftWindowOnWorkspace(pWindow->m_iWorkspaceID);
|
||||||
|
|
||||||
|
if (!pWindowCandidate)
|
||||||
|
pWindowCandidate = g_pCompositor->getFirstWindowOnWorkspace(pWindow->m_iWorkspaceID);
|
||||||
|
|
||||||
|
if (!pWindowCandidate || pWindow == pWindowCandidate || !pWindowCandidate->m_bIsMapped || pWindowCandidate->isHidden() || pWindowCandidate->m_bX11ShouldntFocus ||
|
||||||
|
pWindowCandidate->m_iX11Type == 2 || pWindowCandidate->m_iMonitorID != g_pCompositor->m_pLastMonitor->ID)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return PWINDOWCANDIDATE;
|
return pWindowCandidate;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IHyprLayout::isWindowReachable(CWindow* pWindow) {
|
bool IHyprLayout::isWindowReachable(CWindow* pWindow) {
|
||||||
|
|
Loading…
Reference in a new issue