@@ -47,8 +47,8 @@ FocusScope {
47 if (appDelegate.state === "minimized") {
47 if (appDelegate.state === "minimized") {
48 appDelegate.state = "normal"
48 appDelegate.state = "normal"
50− appDelegate.focusWindow();
51 ApplicationManager.focusApplication(appId);
50 ApplicationManager.focusApplication(appId);
51+ appDelegate.focus = true;
@@ -87,20 +87,22 @@ FocusScope {
87 id: appRepeater
87 id: appRepeater
88 model: ApplicationManager
88 model: ApplicationManager
90− delegate: Item {
90+ delegate: FocusScope {
91 id: appDelegate
91 id: appDelegate
92 z: ApplicationManager.count - index
92 z: ApplicationManager.count - index
93 y: units.gu(3)
93 y: units.gu(3)
94 width: units.gu(60)
94 width: units.gu(60)
95 height: units.gu(50)
95 height: units.gu(50)
99+ ApplicationManager.requestFocusApplication(model.appId);
97 readonly property int minWidth: units.gu(10)
103 readonly property int minWidth: units.gu(10)
98 readonly property int minHeight: units.gu(10)
104 readonly property int minHeight: units.gu(10)
100− function focusWindow() {
101− decoratedWindow.window.forceActiveFocus();
104 states: [
106 states: [
106 name: "normal"
108 name: "normal"
@@ -127,7 +129,7 @@ FocusScope {
127 resizeHandleWidth: units.gu(0.5)
129 resizeHandleWidth: units.gu(0.5)
128 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
130 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
130− onPressed: decoratedWindow.focus = true;
132+ onPressed: appDelegate.focus = true;
133 DecoratedWindow {
135 DecoratedWindow {
@@ -136,12 +138,7 @@ FocusScope {
136 anchors.fill: parent
138 anchors.fill: parent
137 application: ApplicationManager.get(index)
139 application: ApplicationManager.get(index)
138 active: ApplicationManager.focusedApplicationId === model.appId
140 active: ApplicationManager.focusedApplicationId === model.appId
141− if (focus) {
141+ focus: true
142− ApplicationManager.requestFocusApplication(model.appId);
146 onClose: ApplicationManager.stopApplication(model.appId)
143 onClose: ApplicationManager.stopApplication(model.appId)
147 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
144 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")