on xenial help sign in
some fixes if apps are activated from outside the spread while we're in spread mode
3aae925Michael Zanetti
qml/Stages/PhoneStage.qml+19−2
@@ -56,7 +56,11 @@ Item {
56 target: ApplicationManager
56 target: ApplicationManager
57
57
58 onFocusRequested: {
58 onFocusRequested: {
59+ if (spreadView.visible) {
60+ spreadView.snapTo(priv.indexOf(appId))
61+ } else {
59− priv.switchToApp(appId);
62+ priv.switchToApp(appId);
63+ }
60 }
64 }
61
65
62 onFocusedApplicationIdChanged: {
66 onFocusedApplicationIdChanged: {
@@ -138,6 +142,15 @@ Item {
138 applicationSwitchingAnimation.start();
142 applicationSwitchingAnimation.start();
139 }
143 }
140
144
145+ function indexOf(appId) {
146+ for (var i = 0; i < ApplicationManager.count; i++) {
147+ if (ApplicationManager.get(i).appId == appId) {
148+ return i;
149+ }
150+ }
151+ return -1;
152+ }
153+
141 }
154 }
142
155
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 {
444
457
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);
462+ } else {
463+ ApplicationManager.requestFocusApplication(ApplicationManager.get(index).appId);
464+ }
448 }
465 }
449 }
466 }
450 }
467 }