mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-14 11:35:46 -07:00
core: add option to control which window to focus on close (#7368)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user