aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-08-23 18:18:18 +0200
committervaxerski <[email protected]>2022-08-23 18:18:18 +0200
commite2450247c0ca58b8ebc510074bcb11df8c6072e7 (patch)
tree41fc337d3d19934fe288910f82fb26c0769f225a
parent973540bbc597eecdb67ad7804ec12d564332fd44 (diff)
downloadHyprland-e2450247c0ca58b8ebc510074bcb11df8c6072e7.tar.gz
Hyprland-e2450247c0ca58b8ebc510074bcb11df8c6072e7.zip
minor fixes to candidate finding
-rw-r--r--src/events/Windows.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index e0eb47ba..01df7fde 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -397,12 +397,15 @@ void Events::listener_unmapWindow(void* owner, void* data) {
if (!PWINDOWCANDIDATE)
PWINDOWCANDIDATE = g_pCompositor->getFirstWindowOnWorkspace(PWINDOW->m_iWorkspaceID);
- if (!PWINDOWCANDIDATE || PWINDOW == PWINDOWCANDIDATE || !PWINDOWCANDIDATE->m_bIsMapped || PWINDOWCANDIDATE->m_bHidden || PWINDOWCANDIDATE->m_bX11ShouldntFocus || PWINDOWCANDIDATE->m_iX11Type == 2)
+ if (!PWINDOWCANDIDATE || PWINDOW == PWINDOWCANDIDATE || !PWINDOWCANDIDATE->m_bIsMapped || PWINDOWCANDIDATE->m_bHidden || PWINDOWCANDIDATE->m_bX11ShouldntFocus || PWINDOWCANDIDATE->m_iX11Type == 2 || PWINDOWCANDIDATE->m_iMonitorID != g_pCompositor->m_pLastMonitor->ID)
PWINDOWCANDIDATE = nullptr;
Debug::log(LOG, "On closed window, new focused candidate is %x", PWINDOWCANDIDATE);
- g_pCompositor->focusWindow(PWINDOWCANDIDATE);
+ 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);