@@ -167,7 +167,7 @@ Rectangle {
167 // remove the old item
167 // remove the old item
168 focusStack.splice(oldIndex, 1);
168 focusStack.splice(oldIndex, 1);
170− // append to the top of the focus stack
170+ // insert to the top of the focus stack
171 focusStack.unshift(appId);
171 focusStack.unshift(appId);
@@ -175,10 +175,7 @@ Rectangle {
175 var removedIndex = focusStack.indexOf(appId);
175 var removedIndex = focusStack.indexOf(appId);
176 if (removedIndex != -1) {
176 if (removedIndex != -1) {
177 focusStack.splice(removedIndex, 1); // remove one item from the focus stack
177 focusStack.splice(removedIndex, 1); // remove one item from the focus stack
178− if (removedIndex > 1)
179− ApplicationManager.focusApplication(focusStack[removedIndex-1]); // focus the previous one
181− focusFirstInStack(); // focus the next/first one
178+ focusFirstInStack(); // focus the first one