From 7747a38189e75659b195150900865b693c04aab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 6 Nov 2014 22:58:53 +0100 Subject: [PATCH] step into the focus chain at the beginning if the index is 0, we close the circle, but if the index is -1 (invalid) we're "somewhere" and step into the focus chain - reasonably at the beginning BUG: 340594 REVIEW: 121024 --- focuschain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/focuschain.cpp b/focuschain.cpp index bd98b94abb..1930ff813c 100644 --- a/focuschain.cpp +++ b/focuschain.cpp @@ -202,7 +202,10 @@ Client *FocusChain::nextMostRecentlyUsed(Client *reference) const return NULL; } const int index = m_mostRecentlyUsed.indexOf(reference); - if (index == -1 || index == 0) { + if (index == -1) { + return m_mostRecentlyUsed.first(); + } + if (index == 0) { return m_mostRecentlyUsed.last(); } return m_mostRecentlyUsed.at(index - 1);