From fba7ed97fbb3dfe7c2a9ac45ceef2243624eaa04 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 23 Aug 2022 23:15:04 +0200 Subject: don't refocus if candidate is last window --- src/events/Windows.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index e58e5aff..5fb0041d 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -399,10 +399,12 @@ void Events::listener_unmapWindow(void* owner, void* data) { Debug::log(LOG, "On closed window, new focused candidate is %x", PWINDOWCANDIDATE); - if (!PWINDOWCANDIDATE) - g_pInputManager->refocus(); - else - g_pCompositor->focusWindow(PWINDOWCANDIDATE); + if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow) { + if (!PWINDOWCANDIDATE) + g_pInputManager->refocus(); + else + g_pCompositor->focusWindow(PWINDOWCANDIDATE); + } Debug::log(LOG, "Destroying the SubSurface tree of unmapped window %x", PWINDOW); SubsurfaceTree::destroySurfaceTree(PWINDOW->m_pSurfaceTree); -- cgit v1.2.3