From 3103119b7cdda67e1d43588ad07a80465626b3c2 Mon Sep 17 00:00:00 2001 From: Chris Naporlee <55722668+chrisn731@users.noreply.github.com> Date: Sat, 28 Mar 2026 11:30:25 -0400 Subject: input: allow focus to switch to most recently used window on closed (#13769) --- src/layout/algorithm/Algorithm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/layout/algorithm') 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& CAlgorithm::floatingAlgo() const { } SP CAlgorithm::getNextCandidate(SP old) { - if (old->floating()) { + static auto FOCUSONCLOSE = CConfigValue("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()) -- cgit v1.2.3