mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 21:45:58 +01:00
don't find a new candidate to refocus on unfocused unmap
This commit is contained in:
parent
29696d046e
commit
9366c187dc
1 changed files with 19 additions and 12 deletions
|
@ -370,7 +370,10 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
// Allow the renderer to catch the last frame.
|
// Allow the renderer to catch the last frame.
|
||||||
g_pHyprOpenGL->makeWindowSnapshot(PWINDOW);
|
g_pHyprOpenGL->makeWindowSnapshot(PWINDOW);
|
||||||
|
|
||||||
|
bool wasLastWindow = false;
|
||||||
|
|
||||||
if (PWINDOW == g_pCompositor->m_pLastWindow) {
|
if (PWINDOW == g_pCompositor->m_pLastWindow) {
|
||||||
|
wasLastWindow = true;
|
||||||
g_pCompositor->m_pLastWindow = nullptr;
|
g_pCompositor->m_pLastWindow = nullptr;
|
||||||
g_pCompositor->m_pLastFocus = nullptr;
|
g_pCompositor->m_pLastFocus = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -388,7 +391,8 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
// do this after onWindowRemoved because otherwise it'll think the window is invalid
|
// do this after onWindowRemoved because otherwise it'll think the window is invalid
|
||||||
PWINDOW->m_bIsMapped = false;
|
PWINDOW->m_bIsMapped = false;
|
||||||
|
|
||||||
// refocus on a new window
|
// refocus on a new window if needed
|
||||||
|
if (wasLastWindow) {
|
||||||
auto PWINDOWCANDIDATE = g_pCompositor->vectorToWindowIdeal(PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f);
|
auto PWINDOWCANDIDATE = g_pCompositor->vectorToWindowIdeal(PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f);
|
||||||
|
|
||||||
if (PWORKSPACE->m_bHasFullscreenWindow && (!PWINDOWCANDIDATE->m_bCreatedOverFullscreen || !PWINDOW->m_bIsFloating))
|
if (PWORKSPACE->m_bHasFullscreenWindow && (!PWINDOWCANDIDATE->m_bCreatedOverFullscreen || !PWINDOW->m_bIsFloating))
|
||||||
|
@ -405,6 +409,9 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
else
|
else
|
||||||
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Debug::log(LOG, "Unmapped was not focused, ignoring a refocus.");
|
||||||
|
}
|
||||||
|
|
||||||
Debug::log(LOG, "Destroying the SubSurface tree of unmapped window %x", PWINDOW);
|
Debug::log(LOG, "Destroying the SubSurface tree of unmapped window %x", PWINDOW);
|
||||||
SubsurfaceTree::destroySurfaceTree(PWINDOW->m_pSurfaceTree);
|
SubsurfaceTree::destroySurfaceTree(PWINDOW->m_pSurfaceTree);
|
||||||
|
|
Loading…
Reference in a new issue