@@ -77,7 +77,7 @@ Rectangle {
77 var appIndex = priv.indexOf(appId);
77 var appIndex = priv.indexOf(appId);
78 var appDelegate = appRepeater.itemAt(appIndex);
78 var appDelegate = appRepeater.itemAt(appIndex);
79 appDelegate.minimized = false;
79 appDelegate.minimized = false;
80− ApplicationManager.focusApplication(appId);
80+ appDelegate.focus = true;
@@ -179,7 +179,7 @@ Rectangle {
179 function focusSelected() {
179 function focusSelected() {
180 if (appRepeater.highlightedIndex != -1) {
180 if (appRepeater.highlightedIndex != -1) {
181 var application = ApplicationManager.get(appRepeater.highlightedIndex);
181 var application = ApplicationManager.get(appRepeater.highlightedIndex);
182− ApplicationManager.focusApplication(application.appId);
182+ ApplicationManager.requestFocusApplication(application.appId)
@@ -204,7 +204,11 @@ Rectangle {
204 property bool maximized: false
204 property bool maximized: false
205 property bool minimized: false
205 property bool minimized: false
207− focus: priv.focusedAppId === model.appId && root.state !== "altTab"
207+ onFocusChanged: {
208+ if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
209+ ApplicationManager.focusApplication(model.appId);
209 Binding {
213 Binding {
210 target: ApplicationManager.get(index)
214 target: ApplicationManager.get(index)
@@ -315,7 +319,7 @@ Rectangle {
315 resizeHandleWidth: units.gu(2)
319 resizeHandleWidth: units.gu(2)
316 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
320 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
318− onPressed: ApplicationManager.focusApplication(model.appId);
322+ onPressed: { appDelegate.focus = true; }
321 DecoratedWindow {
325 DecoratedWindow {