From 34bf7d31c4f3997893cc76e3e5c78b2ccf91eecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 6 Jul 2016 17:35:28 +0200 Subject: prefer m_cycling_next over s_focused_window as cycle start (former is where we wanted to go and X11 is still async) --- src/FocusControl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 716883b..f60e9dd 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -110,7 +110,11 @@ void FocusControl::cycleFocus(const FocusableList &window_list, Focusables::const_iterator it_end = window_list.clientList().end(); // too many things can go wrong with remembering this - m_cycling_window = find(it_begin, it_end, s_focused_window); + m_cycling_window = it_end; + if (m_cycling_next) + m_cycling_window = find(it_begin, it_end, m_cycling_next); + if (m_cycling_window == it_end) + m_cycling_window = find(it_begin, it_end, s_focused_window); if (m_cycling_window == it_end) m_cycling_window = find(it_begin, it_end, s_focused_fbwindow); @@ -144,6 +148,7 @@ void FocusControl::cycleFocus(const FocusableList &window_list, // now we actually try to focus the window if (!doSkipWindow(**it, pat) && (m_cycling_next = *it) && (*it)->focus()) break; + m_cycling_next = 0; } m_cycling_window = it; -- cgit v0.11.2