on xenial help sign in
fix switching to sideStaged mode from windowed
aaee5f4Michael Zanetti
qml/Stage/Stage.qml+6−27
@@ -34,9 +34,7 @@ AbstractStage {
34 function updateFocusedAppOrientation() { /* TODO */ }
34 function updateFocusedAppOrientation() { /* TODO */ }
35 function updateFocusedAppOrientationAnimated() { /* TODO */}
35 function updateFocusedAppOrientationAnimated() { /* TODO */}
36 function pushRightEdge(amount) {
36 function pushRightEdge(amount) {
37−// if (state === "windowed" || state == "") {
38− edgeBarrier.push(amount);
37+ edgeBarrier.push(amount);
39−// }
40 }
38 }
41 function closeFocusedDelegate() {
39 function closeFocusedDelegate() {
42 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
40 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
@@ -143,7 +141,6 @@ AbstractStage {
143 property var focusedAppDelegate: null
141 property var focusedAppDelegate: null
144 onFocusedAppDelegateChanged: {
142 onFocusedAppDelegateChanged: {
145 if (focusedAppDelegate && root.state == "spread") {
143 if (focusedAppDelegate && root.state == "spread") {
146− print("clsing spread because of focus change to", focusedAppDelegate.application.appId)
147 goneToSpread = false;
144 goneToSpread = false;
148 }
145 }
149 }
146 }
@@ -206,7 +203,6 @@ AbstractStage {
206 }
203 }
207
204
208 function updateMainAndSideStageIndexes() {
205 function updateMainAndSideStageIndexes() {
209−// print("updating stage indexes, sideStage shown:", sideStage.shown)
210 if (root.mode != "stagedWithSideStage") {
206 if (root.mode != "stagedWithSideStage") {
211 priv.sideStageDelegate = null;
207 priv.sideStageDelegate = null;
212 priv.sideStageItemId = 0;
208 priv.sideStageItemId = 0;
@@ -225,7 +221,7 @@ AbstractStage {
225
221
226 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
222 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
227 var appDelegate = appRepeater.itemAt(i);
223 var appDelegate = appRepeater.itemAt(i);
228− if (/*sideStage.shown && */appDelegate.stage == ApplicationInfoInterface.SideStage
224+ if (appDelegate.stage == ApplicationInfoInterface.SideStage
229 && !choseSideStage) {
225 && !choseSideStage) {
230 priv.sideStageDelegate = appDelegate
226 priv.sideStageDelegate = appDelegate
231 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
227 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
@@ -248,14 +244,11 @@ AbstractStage {
248 priv.sideStageItemId = 0;
244 priv.sideStageItemId = 0;
249 priv.sideStageAppId = "";
245 priv.sideStageAppId = "";
250 }
246 }
251−
252− print("*** updated! MainStage:", priv.mainStageAppId, "SideStage:", priv.sideStageAppId)
253 }
247 }
254
248
255 property int nextInStack: {
249 property int nextInStack: {
256 var mainStageIndex = priv.mainStageDelegate ? priv.mainStageDelegate.itemIndex : -1;
250 var mainStageIndex = priv.mainStageDelegate ? priv.mainStageDelegate.itemIndex : -1;
257 var sideStageIndex = priv.sideStageDelegate ? priv.sideStageDelegate.itemIndex : -1;
251 var sideStageIndex = priv.sideStageDelegate ? priv.sideStageDelegate.itemIndex : -1;
258−// print("calculating nextInStack:", mainStageIndex, sideStageIndex, priv.mainStageDelegate.itemIndex, priv.sideStageDelegate.itemIndex)
259 if (sideStageIndex == -1) {
252 if (sideStageIndex == -1) {
260 return topLevelSurfaceList.count > 1 ? 1 : -1;
253 return topLevelSurfaceList.count > 1 ? 1 : -1;
261 }
254 }
@@ -378,7 +371,6 @@ AbstractStage {
378 },
371 },
379 State {
372 State {
380 name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
373 name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
381−// PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate && priv.sideStageDelegate.itemIndex < 2 ? 2 : 1 }
382 },
374 },
383 State {
375 State {
384 name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
376 name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
@@ -389,7 +381,6 @@ AbstractStage {
389 State {
381 State {
390 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
382 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
391 PropertyChanges { target: triGestureArea; enabled: true }
383 PropertyChanges { target: triGestureArea; enabled: true }
392−// PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate && priv.sideStageDelegate.itemIndex < 2 ? 2 : 1 }
393 PropertyChanges { target: sideStage; visible: true }
384 PropertyChanges { target: sideStage; visible: true }
394 },
385 },
395 State {
386 State {
@@ -427,6 +418,10 @@ AbstractStage {
427 Transition {
418 Transition {
428 to: "stagedRightEdge"
419 to: "stagedRightEdge"
429 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
420 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
421+ },
422+ Transition {
423+ to: "stagedWithSideStage"
424+ ScriptAction { script: priv.updateMainAndSideStageIndexes(); }
430 }
425 }
431
426
432 ]
427 ]
@@ -510,27 +505,11 @@ AbstractStage {
510 }
505 }
511
506
512 onShownChanged: {
507 onShownChanged: {
513− print("sidestage shown changed:", shown)
514 if (!shown && priv.mainStageDelegate) {
508 if (!shown && priv.mainStageDelegate) {
515− print("claiming focus 2")
516 priv.mainStageDelegate.claimFocus();
509 priv.mainStageDelegate.claimFocus();
517 }
510 }
518 }
511 }
519
512
520−// onShownChanged: {
521−// if (!shown && priv.sideStageDelegate && priv.focusedAppDelegate === priv.sideStageDelegate) {
522−// priv.updateMainAndSideStageIndexes();
523−// if (priv.mainStageDelegate) {
524−// priv.mainStageDelegate.focus = true;
525−// }
526−// } else if (shown) {
527−// priv.updateMainAndSideStageIndexes();
528−// if (priv.sideStageDelegate) {
529−// priv.sideStageDelegate.focus = true;
530−// }
531−// }
532−// }
533−
534 DropArea {
513 DropArea {
535 id: sideStageDropArea
514 id: sideStageDropArea
536 objectName: "SideStageDropArea"
515 objectName: "SideStageDropArea"