on xenial help sign in
always focus the first app in the stack, based on recency
bbce293Lukáš Tinkl
qml/Stages/DesktopStage.qml+2−5
@@ -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);
169 }
169 }
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);
172 }
172 }
173
173
@@ -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
180− else
181− focusFirstInStack(); // focus the next/first one
178+ focusFirstInStack(); // focus the first one
182 }
179 }
183 }
180 }
184
181