@@ -77,7 +77,6 @@ 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− appDelegate.focus = true;
81 ApplicationManager.focusApplication(appId);
80 ApplicationManager.focusApplication(appId);
@@ -91,12 +90,6 @@ Rectangle {
91 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
90 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
94− onFocusedAppDelegateChanged: {
95− if (focusedAppDelegate) {
96− focusedAppDelegate.focus = true;
100 function indexOf(appId) {
93 function indexOf(appId) {
101 for (var i = 0; i < ApplicationManager.count; i++) {
94 for (var i = 0; i < ApplicationManager.count; i++) {
102 if (ApplicationManager.get(i).appId == appId) {
95 if (ApplicationManager.get(i).appId == appId) {
@@ -140,17 +133,21 @@ Rectangle {
140 case Qt.Key_Left:
133 case Qt.Key_Left:
141 case Qt.Key_Backtab:
134 case Qt.Key_Backtab:
142 selectPrevious(event.isAutoRepeat)
135 selectPrevious(event.isAutoRepeat)
136+ event.accepted = true;
144 case Qt.Key_Right:
138 case Qt.Key_Right:
145 case Qt.Key_Tab:
139 case Qt.Key_Tab:
146 selectNext(event.isAutoRepeat)
140 selectNext(event.isAutoRepeat)
141+ event.accepted = true;
148 case Qt.Key_Escape:
143 case Qt.Key_Escape:
149 appRepeater.highlightedIndex = -1
144 appRepeater.highlightedIndex = -1
145+ event.accepted = true;
150 case Qt.Key_Enter:
146 case Qt.Key_Enter:
151 case Qt.Key_Return:
147 case Qt.Key_Return:
152 case Qt.Key_Space:
148 case Qt.Key_Space:
153 root.state = ""
149 root.state = ""
150+ event.accepted = true;
@@ -181,7 +178,8 @@ Rectangle {
182 function focusSelected() {
179 function focusSelected() {
183 if (appRepeater.highlightedIndex != -1) {
180 if (appRepeater.highlightedIndex != -1) {
184− appRepeater.itemAt(appRepeater.highlightedIndex).focus = true;
181+ var application = ApplicationManager.get(appRepeater.highlightedIndex);
182+ ApplicationManager.focusApplication(application.appId);
@@ -206,11 +204,7 @@ Rectangle {
206 property bool maximized: false
204 property bool maximized: false
207 property bool minimized: false
205 property bool minimized: false
209− onFocusChanged: {
207+ focus: priv.focusedAppId === model.appId && root.state !== "altTab"
210− if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
211− ApplicationManager.requestFocusApplication(model.appId);
215 Binding {
209 Binding {
216 target: ApplicationManager.get(index)
210 target: ApplicationManager.get(index)
@@ -321,7 +315,7 @@ Rectangle {
321 resizeHandleWidth: units.gu(2)
315 resizeHandleWidth: units.gu(2)
322 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
316 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
324− onPressed: appDelegate.focus = true;
318+ onPressed: ApplicationManager.focusApplication(model.appId);
327 DecoratedWindow {
321 DecoratedWindow {
@@ -577,7 +571,6 @@ Rectangle {
577 PropertyChanges { target: spreadFlickable; enabled: true }
571 PropertyChanges { target: spreadFlickable; enabled: true }
578 PropertyChanges { target: currentSelectedLabel; visible: true }
572 PropertyChanges { target: currentSelectedLabel; visible: true }
579 PropertyChanges { target: spreadBackground; visible: true }
573 PropertyChanges { target: spreadBackground; visible: true }
580− PropertyChanges { target: appContainer; focus: true }
583 signal updateWorkspaces();
576 signal updateWorkspaces();