Correct traversal order in FocusChain::moveAfterWindowInChain()
The first item in the `chain` list corresponds to the last item in the focus chain. The last item in the `chain` list corresponds to the first item in the focus chain. Given that, we need to traverse the list from the start to the end in order to find the first window owned by the same app as `reference`.
This commit is contained in:
parent
1c7c16f28b
commit
22e10f6efb
1 changed files with 1 additions and 1 deletions
|
@ -184,7 +184,7 @@ void FocusChain::moveAfterWindowInChain(Window *window, Window *reference, Chain
|
||||||
chain.insert(chain.indexOf(reference), window);
|
chain.insert(chain.indexOf(reference), window);
|
||||||
} else {
|
} else {
|
||||||
chain.removeAll(window);
|
chain.removeAll(window);
|
||||||
for (int i = chain.size() - 1; i >= 0; --i) {
|
for (int i = 0; i < chain.size(); ++i) {
|
||||||
if (Window::belongToSameApplication(reference, chain.at(i))) {
|
if (Window::belongToSameApplication(reference, chain.at(i))) {
|
||||||
chain.insert(i, window);
|
chain.insert(i, window);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue