diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/supplementary/ConfigDescriptions.hpp | 8 | ||||
| -rw-r--r-- | src/layout/algorithm/Algorithm.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/config/supplementary/ConfigDescriptions.hpp b/src/config/supplementary/ConfigDescriptions.hpp index 6a287d43..7d752e5a 100644 --- a/src/config/supplementary/ConfigDescriptions.hpp +++ b/src/config/supplementary/ConfigDescriptions.hpp @@ -655,9 +655,9 @@ namespace Config::Supplementary { .value = "input:focus_on_close", .description = "Controls the window focus behavior when a window is closed. When set to 0, focus will shift to the next window candidate. When set to 1, focus will shift " - "to the window under the cursor.", + "to the window under the cursor. When set to 2, focus will shift to the most recently used/active window.", .type = CONFIG_OPTION_CHOICE, - .data = SConfigOptionDescription::SChoiceData{0, "next,cursor"}, + .data = SConfigOptionDescription::SChoiceData{0, "next,cursor,mru"}, }, SConfigOptionDescription{ .value = "input:mouse_refocus", @@ -697,8 +697,8 @@ namespace Config::Supplementary { }, /* - * input:touchpad: - */ + * input:touchpad: + */ SConfigOptionDescription{ .value = "input:touchpad:disable_while_typing", diff --git a/src/layout/algorithm/Algorithm.cpp b/src/layout/algorithm/Algorithm.cpp index b83a03a3..b9e94524 100644 --- a/src/layout/algorithm/Algorithm.cpp +++ b/src/layout/algorithm/Algorithm.cpp @@ -237,7 +237,9 @@ const UP<IFloatingAlgorithm>& CAlgorithm::floatingAlgo() const { } SP<ITarget> CAlgorithm::getNextCandidate(SP<ITarget> old) { - if (old->floating()) { + static auto FOCUSONCLOSE = CConfigValue<Hyprlang::INT>("input:focus_on_close"); + + if (old->floating() || *FOCUSONCLOSE == 2) { // use window history to determine best target for (const auto& w : Desktop::History::windowTracker()->fullHistory() | std::views::reverse) { if (!w->m_workspace || w->m_workspace->m_space != m_space || !w->layoutTarget() || !w->layoutTarget()->space()) |
