@@ -46,7 +46,7 @@ Item {
46 target: ApplicationManager
46 target: ApplicationManager
48 onFocusRequested: {
48 onFocusRequested: {
49− if (spreadView.visible) {
49+ if (spreadView.phase > 0) {
50 spreadView.snapTo(priv.indexOf(appId));
50 spreadView.snapTo(priv.indexOf(appId));
52 priv.switchToApp(appId);
52 priv.switchToApp(appId);
@@ -55,12 +55,8 @@ Item {
56 onFocusedApplicationIdChanged: {
56 onFocusedApplicationIdChanged: {
57 if (ApplicationManager.focusedApplicationId.length > 0) {
57 if (ApplicationManager.focusedApplicationId.length > 0) {
58− if (priv.secondApplicationStarting || priv.applicationStarting) {
59− appSplashTimer.restart();
61− var application = priv.focusedApplication;
58+ var application = priv.focusedApplication;
62− root.fullscreen = application.fullscreen;
59+ root.fullscreen = application.fullscreen;
65 spreadView.selectedIndex = -1;
61 spreadView.selectedIndex = -1;
66 spreadView.phase = 0;
62 spreadView.phase = 0;
@@ -69,7 +65,13 @@ Item {
71 onApplicationAdded: {
67 onApplicationAdded: {
68+ if (spreadView.phase > 0) {
72− spreadView.snapTo(0);
69+ spreadView.snapTo(0);
71+// TODO: Enable this once a newly added app is not directly focused any more.
73+// priv.switchToApp(appId)
@@ -79,16 +81,11 @@ Item {
79 property string focusedAppId: ApplicationManager.focusedApplicationId
81 property string focusedAppId: ApplicationManager.focusedApplicationId
80 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
82 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
82− property bool applicationStarting: false
83− property bool secondApplicationStarting: false
85− property string newFocusedAppId
87 function switchToApp(appId) {
84 function switchToApp(appId) {
88 if (priv.focusedAppId) {
85 if (priv.focusedAppId) {
89− priv.newFocusedAppId = appId;
90 root.fullscreen = ApplicationManager.findApplication(appId).fullscreen;
86 root.fullscreen = ApplicationManager.findApplication(appId).fullscreen;
91− applicationSwitchingAnimation.start();
87+ spreadView.focusChanging = true
88+ ApplicationManager.focusApplication(appId);
93 ApplicationManager.focusApplication(appId);
90 ApplicationManager.focusApplication(appId);
@@ -154,6 +151,8 @@ Item {
154 property int draggedIndex: -1
151 property int draggedIndex: -1
155 property int closingIndex: -1
152 property int closingIndex: -1
154+ property bool focusChanging: false
157 onShiftedContentXChanged: {
156 onShiftedContentXChanged: {
158 switch (phase) {
157 switch (phase) {
@@ -268,6 +267,18 @@ Item {
271+ enabled: spreadView.focusChanging && index == 0
272+ UbuntuNumberAnimation {
273+ duration: UbuntuAnimation.FastDuration
276+ spreadView.focusChanging = false
271 // Each tile has a different progress value running from 0 to 1.
282 // Each tile has a different progress value running from 0 to 1.
272 // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
283 // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
273 progress: {
284 progress: {