@@ -60,8 +60,8 @@ Item {
60 priv.mainStageAppId = focusedAppId;
60 priv.mainStageAppId = focusedAppId;
63− appId0 = ApplicationManager.get(0).appId;
63+ appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
64− appId1 = ApplicationManager.get(1).appId;
64+ appId1 = ApplicationManager.count > 1 ? ApplicationManager.get(1).appId : "";
67 function indexOf(appId) {
67 function indexOf(appId) {
@@ -173,16 +173,20 @@ Item {
173 return 1;
173 return 1;
175 return 0;
175 return 0;
177+ print("foo", priv.appId0, priv.appId1)
177 print("unhandled nextInStack case!!!!!");
180 print("unhandled nextInStack case!!!!!");
178 return -1;
181 return -1;
180 property int nextZInStack: indexToZIndex(nextInStack)
184 property int nextZInStack: indexToZIndex(nextInStack)
181 onNextInStackChanged: print("next in stack is", nextInStack)
185 onNextInStackChanged: print("next in stack is", nextInStack)
183 states: [
187 states: [
185− name: "invalid" // temporary until Dash is an app and we always have a main stage app
189+ name: "invalid"
188 name: "main"
192 name: "main"
@@ -246,10 +250,21 @@ Item {
246 // We don't want to really reorder them in the model because that allows us to keep track
250 // We don't want to really reorder them in the model because that allows us to keep track
247 // of the last focused order.
251 // of the last focused order.
248 function indexToZIndex(index) {
252 function indexToZIndex(index) {
253+ print("zIndex calc for index", index);
249 var app = ApplicationManager.get(index);
254 var app = ApplicationManager.get(index);
250 var isActive = app.appId == priv.mainStageAppId || app.appId == priv.sideStageAppId;
259 var isActive = app.appId == priv.mainStageAppId || app.appId == priv.sideStageAppId;
260+ print("got app", app.appId, isActive)
251 if (isActive && app.stage == ApplicationInfoInterface.MainStage) return 0;
261 if (isActive && app.stage == ApplicationInfoInterface.MainStage) return 0;
252 if (isActive && app.stage == ApplicationInfoInterface.SideStage) {
262 if (isActive && app.stage == ApplicationInfoInterface.SideStage) {
263+ if (!priv.mainStageAppId) {
264+ // only have SS apps running
253 if (spreadView.nextInStack >= 0 && ApplicationManager.get(spreadView.nextInStack).stage == ApplicationInfoInterface.MainStage) {
268 if (spreadView.nextInStack >= 0 && ApplicationManager.get(spreadView.nextInStack).stage == ApplicationInfoInterface.MainStage) {
254 return Math.max(index, 2);
269 return Math.max(index, 2);
@@ -260,7 +275,7 @@ Item {
260 return priv.indexOf(priv.sideStageAppId) < index ? index - 1 : index;
275 return priv.indexOf(priv.sideStageAppId) < index ? index - 1 : index;
262 if (index == spreadView.nextInStack && app.stage == ApplicationInfoInterface.SideStage) {
277 if (index == spreadView.nextInStack && app.stage == ApplicationInfoInterface.SideStage) {
263− if (priv.sideStageAppId) {
278+ if (priv.sideStageAppId && priv.mainStageAppId) {
264 return 2;
279 return 2;
266 return 1;
281 return 1;
@@ -406,7 +421,9 @@ Item {
406 sideStageDragHandle.dragging = true;
421 sideStageDragHandle.dragging = true;
408 onMouseXChanged: {
423 onMouseXChanged: {
424+ if (priv.mainStageAppId) {
409− sideStageDragHandle.progress = Math.max(0, (-startX + mouseX) / spreadView.sideStageWidth)
425+ sideStageDragHandle.progress = Math.max(0, (-startX + mouseX) / spreadView.sideStageWidth)
410 gesturePoints.push(mouseX);
427 gesturePoints.push(mouseX);
412 onReleased: {
429 onReleased: {