Skip to content

Commit

Permalink
don't refocus if candidate is last window
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Aug 23, 2022
1 parent fd70a91 commit fba7ed9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/events/Windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fba7ed9

Please sign in to comment.