diff options
| author | ParaN3xus <136563585+ParaN3xus@users.noreply.github.com> | 2024-08-21 18:24:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-21 11:24:42 +0100 |
| commit | 946ed1f32ae8e3840d1b3bb04c6e048ca7501fba (patch) | |
| tree | 647e1708e6cf11242c40fac6455d6089ebcf1030 /src/events/Windows.cpp | |
| parent | 4eff224a7f6f4baa5600f687d6f2ef4ad8340ad3 (diff) | |
core: add option to control which window to focus on close (#7368)
Diffstat (limited to 'src/events/Windows.cpp')
| -rw-r--r-- | src/events/Windows.cpp | 7 |
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); |
