aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/events
diff options
context:
space:
mode:
authorParaN3xus <[email protected]>2024-08-21 18:24:42 +0800
committerGitHub <[email protected]>2024-08-21 11:24:42 +0100
commit946ed1f32ae8e3840d1b3bb04c6e048ca7501fba (patch)
tree647e1708e6cf11242c40fac6455d6089ebcf1030 /src/events
parent4eff224a7f6f4baa5600f687d6f2ef4ad8340ad3 (diff)
downloadHyprland-946ed1f32ae8e3840d1b3bb04c6e048ca7501fba.tar.gz
Hyprland-946ed1f32ae8e3840d1b3bb04c6e048ca7501fba.zip
core: add option to control which window to focus on close (#7368)
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);