aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/events')
-rw-r--r--src/events/Windows.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 2eb7038f..e4e3900b 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -648,7 +648,12 @@ void Events::listener_unmapWindow(void* owner, void* data) {
// refocus on a new window if needed
if (wasLastWindow) {
- const auto PWINDOWCANDIDATE = g_pLayoutManager->getCurrentLayout()->getNextWindowCandidate(PWINDOW);
+ static auto FOCUSONCLOSE = CConfigValue<Hyprlang::INT>("input:focus_on_close");
+ PHLWINDOW PWINDOWCANDIDATE = nullptr;
+ if (*FOCUSONCLOSE)
+ PWINDOWCANDIDATE = (g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING));
+ else
+ PWINDOWCANDIDATE = g_pLayoutManager->getCurrentLayout()->getNextWindowCandidate(PWINDOW);
Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE);