@@ -56,7 +56,11 @@ Item {
56 target: ApplicationManager
56 target: ApplicationManager
58 onFocusRequested: {
58 onFocusRequested: {
59+ if (spreadView.visible) {
60+ spreadView.snapTo(priv.indexOf(appId))
59− priv.switchToApp(appId);
62+ priv.switchToApp(appId);
62 onFocusedApplicationIdChanged: {
66 onFocusedApplicationIdChanged: {
@@ -138,6 +142,15 @@ Item {
138 applicationSwitchingAnimation.start();
142 applicationSwitchingAnimation.start();
145+ function indexOf(appId) {
146+ for (var i = 0; i < ApplicationManager.count; i++) {
147+ if (ApplicationManager.get(i).appId == appId) {
143 // FIXME: the signal connection seems to get lost with the fake application manager.
156 // FIXME: the signal connection seems to get lost with the fake application manager.
@@ -444,7 +457,11 @@ Item {
445 onClicked: {
458 onClicked: {
446 if (spreadView.stage == 2) {
459 if (spreadView.stage == 2) {
460+ if (ApplicationManager.focusedApplicationId == ApplicationManager.get(index).appId) {
447− spreadView.snapTo(index);
461+ spreadView.snapTo(index);
463+ ApplicationManager.requestFocusApplication(ApplicationManager.get(index).appId);