@@ -179,7 +179,6 @@ AbstractStage {
179 for (var i = 0; i < appRepeater.count; i++) {
179 for (var i = 0; i < appRepeater.count; i++) {
180 var appDelegate = appRepeater.itemAt(i);
180 var appDelegate = appRepeater.itemAt(i);
181 if (appDelegate && !appDelegate.minimized) {
181 if (appDelegate && !appDelegate.minimized) {
182− print("***** focusing because of focusNext() call", appDelegate.application.appId)
183 appDelegate.focus = true;
182 appDelegate.focus = true;
@@ -402,9 +401,7 @@ AbstractStage {
402 SequentialAnimation {
401 SequentialAnimation {
403 ScriptAction {
402 ScriptAction {
404 script: {
403 script: {
405− print("hightedIndex is:", spreadItem.highlightedIndex)
406 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
404 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
407− print("playing focus animation 3 on item", spreadItem.highlightedIndex, item.application.appId)
409 item.playFocusAnimation();
406 item.playFocusAnimation();
410 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
407 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -475,7 +472,6 @@ AbstractStage {
475 enabled: sideStage.enabled
472 enabled: sideStage.enabled
477 onDropped: {
474 onDropped: {
478− print("dropped on main stage drop area")
479 drop.source.appDelegate.saveStage(ApplicationInfoInterface.MainStage);
475 drop.source.appDelegate.saveStage(ApplicationInfoInterface.MainStage);
480 drop.source.appDelegate.focus = true;
476 drop.source.appDelegate.focus = true;
@@ -526,7 +522,6 @@ AbstractStage {
526 onDropped: {
522 onDropped: {
527 if (drop.keys == "MainStage") {
523 if (drop.keys == "MainStage") {
528 drop.source.appDelegate.saveStage(ApplicationInfoInterface.SideStage);
524 drop.source.appDelegate.saveStage(ApplicationInfoInterface.SideStage);
529− print("dropped on mainstage")
530 drop.source.appDelegate.focus = true;
525 drop.source.appDelegate.focus = true;
@@ -676,7 +671,6 @@ AbstractStage {
676 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem
671 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem
678 function claimFocus() {
673 function claimFocus() {
679− print("(claimfocus) focusing app", priv.sideStageDelegate, appDelegate, sideStage.shown)
680 if (root.state == "spread") {
674 if (root.state == "spread") {
681 priv.goneToSpread = false;
675 priv.goneToSpread = false;
@@ -695,7 +689,6 @@ AbstractStage {
695 onFocusRequested: {
689 onFocusRequested: {
696 // Reset spread selection in case there is any
690 // Reset spread selection in case there is any
697 spreadItem.highlightedIndex = -1
691 spreadItem.highlightedIndex = -1
698− print("claiming focus 3")
699 claimFocus();
692 claimFocus();
@@ -705,7 +698,6 @@ AbstractStage {
705 if (!model.surface) {
698 if (!model.surface) {
706 // when an app has no surfaces, we assume there's only one entry representing it:
699 // when an app has no surfaces, we assume there's only one entry representing it:
707 // this delegate.
700 // this delegate.
708− print("claiming focus 4")
709 claimFocus();
701 claimFocus();
711 // if the application has surfaces, focus request should be at surface-level.
703 // if the application has surfaces, focus request should be at surface-level.
@@ -738,7 +730,6 @@ AbstractStage {
738 if (!appRepeater.startingUp) {
730 if (!appRepeater.startingUp) {
739 // a top level window is always the focused one when it first appears, unfocusing
731 // a top level window is always the focused one when it first appears, unfocusing
740 // any preexisting one
732 // any preexisting one
741− print("focusing because of creation")
742 focus = true;
733 focus = true;
@@ -760,7 +751,6 @@ AbstractStage {
760 for (var i = 0; i < appRepeater.count; i++) {
751 for (var i = 0; i < appRepeater.count; i++) {
761 var appDelegate = appRepeater.itemAt(i);
752 var appDelegate = appRepeater.itemAt(i);
762 if (appDelegate && !appDelegate.minimized && i != index) {
753 if (appDelegate && !appDelegate.minimized && i != index) {
763− print("focusing some other because of destruction")
764 appDelegate.focus = true;
754 appDelegate.focus = true;
@@ -837,24 +827,20 @@ AbstractStage {
837 animationsEnabled = (animated === undefined) || animated;
827 animationsEnabled = (animated === undefined) || animated;
838 windowState = state || WindowStateStorage.WindowStateRestored;
828 windowState = state || WindowStateStorage.WindowStateRestored;
839 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
829 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
840− print("***** focusing because of window restore", model.application.appId)
841 focus = true;
830 focus = true;
844 function playFocusAnimation() {
833 function playFocusAnimation() {
845− print("playing focus animation", state, root.mode, "app", model.application.appId)
846 if (state == "stagedRightEdge") {
834 if (state == "stagedRightEdge") {
847 // TODO: Can we drop this if and find something that always works?
835 // TODO: Can we drop this if and find something that always works?
848 if (root.mode == "staged") {
836 if (root.mode == "staged") {
849 rightEdgeFocusAnimation.targetX = 0
837 rightEdgeFocusAnimation.targetX = 0
850− print("doing it to 0")
851 rightEdgeFocusAnimation.start()
838 rightEdgeFocusAnimation.start()
852 } else if (root.mode == "stagedWithSideStage") {
839 } else if (root.mode == "stagedWithSideStage") {
853 rightEdgeFocusAnimation.targetX = appDelegate.stage == ApplicationInfoInterface.SideStage ? sideStage.x : 0
840 rightEdgeFocusAnimation.targetX = appDelegate.stage == ApplicationInfoInterface.SideStage ? sideStage.x : 0
854 rightEdgeFocusAnimation.start()
841 rightEdgeFocusAnimation.start()
856 } else if (state == "windowedRightEdge" || root.mode == "windowed") {
843 } else if (state == "windowedRightEdge" || root.mode == "windowed") {
857− print("claiming focus 1")
858 claimFocus();
844 claimFocus();
860 focusAnimation.start()
846 focusAnimation.start()
@@ -893,29 +879,24 @@ AbstractStage {
894 duration: UbuntuAnimation.SnapDuration
880 duration: UbuntuAnimation.SnapDuration
895 onStarted: {
881 onStarted: {
896− print("starting focusanimation for", model.application.appId)
897 topLevelSurfaceList.raiseId(model.id);
882 topLevelSurfaceList.raiseId(model.id);
899 onStopped: {
884 onStopped: {
900− print("focusing because of normal focus animation finishing")
901 appDelegate.focus = true
885 appDelegate.focus = true
904 ParallelAnimation {
888 ParallelAnimation {
905 id: rightEdgeFocusAnimation
889 id: rightEdgeFocusAnimation
906 property int targetX: 0
890 property int targetX: 0
907− onStarted: print("starting rightedgefocusanimation for", model.application.appId)
908 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: rightEdgeFocusAnimation.targetX; duration: priv.animationDuration }
891 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: rightEdgeFocusAnimation.targetX; duration: priv.animationDuration }
909 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
892 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
910 UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
893 UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
911 onStopped: {
894 onStopped: {
912− print("focusing", model.application.appId, "because of right edge focus animation completion");
913 appDelegate.focus = true
895 appDelegate.focus = true
916 ParallelAnimation {
898 ParallelAnimation {
917 id: hidingAnimation
899 id: hidingAnimation
918− onStarted: print("starting hiding animation for", model.application.appId)
919 UbuntuNumberAnimation { target: appDelegate; property: "opacity"; to: 0; duration: priv.animationDuration }
900 UbuntuNumberAnimation { target: appDelegate; property: "opacity"; to: 0; duration: priv.animationDuration }
920 onStopped: appDelegate.opacity = 1
901 onStopped: appDelegate.opacity = 1
@@ -1303,14 +1284,10 @@ AbstractStage {
1303 windowedRightEdgeMaths.startY = appDelegate.requestedY
1284 windowedRightEdgeMaths.startY = appDelegate.requestedY
1305 if (index == 1) {
1286 if (index == 1) {
1306− print("should calculate overlap from", model.application.appId, "with", appRepeater.itemAt(0).application.appId)
1307 var thisRect = { x: appDelegate.windowedX, y: appDelegate.windowedY, width: appDelegate.requestedWidth, height: appDelegate.requestedHeight }
1287 var thisRect = { x: appDelegate.windowedX, y: appDelegate.windowedY, width: appDelegate.requestedWidth, height: appDelegate.requestedHeight }
1308− print("thisRect:", thisRect.x, thisRect.y, thisRect.width, thisRect.height)
1309 var otherDelegate = appRepeater.itemAt(0);
1288 var otherDelegate = appRepeater.itemAt(0);
1310 var otherRect = { x: otherDelegate.windowedX, y: otherDelegate.windowedY, width: otherDelegate.requestedWidth, height: otherDelegate.requestedHeight }
1289 var otherRect = { x: otherDelegate.windowedX, y: otherDelegate.windowedY, width: otherDelegate.requestedWidth, height: otherDelegate.requestedHeight }
1311− print("otherRect:", otherRect.x, otherRect.y, otherRect.width, otherRect.height)
1312 var intersectionRect = MathUtils.intersectionRect(thisRect, otherRect)
1290 var intersectionRect = MathUtils.intersectionRect(thisRect, otherRect)
1313− print("intersection is", intersectionRect.x, intersectionRect.y, intersectionRect.width, intersectionRect.height)
1314 var mappedInterSectionRect = appDelegate.mapFromItem(root, intersectionRect.x, intersectionRect.y)
1291 var mappedInterSectionRect = appDelegate.mapFromItem(root, intersectionRect.x, intersectionRect.y)
1315 opacityEffect.maskX = mappedInterSectionRect.x
1292 opacityEffect.maskX = mappedInterSectionRect.x
1316 opacityEffect.maskY = mappedInterSectionRect.y
1293 opacityEffect.maskY = mappedInterSectionRect.y
@@ -1369,7 +1346,6 @@ AbstractStage {
1369 visible: enabled
1346 visible: enabled
1371 onPressed: {
1348 onPressed: {
1372− print("***** focusing because of resize area press", model.application.appId)
1373 appDelegate.focus = true;
1349 appDelegate.focus = true;
@@ -1482,7 +1458,6 @@ AbstractStage {
1483 onClicked: {
1459 onClicked: {
1484 spreadItem.highlightedIndex = index;
1460 spreadItem.highlightedIndex = index;
1485− print("*****************setting highlighted index to:", index, appRepeater.itemAt(index))
1486 if (distance == 0) {
1461 if (distance == 0) {
1487 priv.goneToSpread = false;
1462 priv.goneToSpread = false;
@@ -1669,7 +1644,6 @@ AbstractStage {
1671 onDraggingChanged: {
1646 onDraggingChanged: {
1672− print("dda dragging changed", dragging)
1673 if (dragging) {
1647 if (dragging) {
1674 // A potential edge-drag gesture has started. Start recording it
1648 // A potential edge-drag gesture has started. Start recording it
1675 gesturePoints = [];
1649 gesturePoints = [];
@@ -1683,7 +1657,6 @@ AbstractStage {
1683 var oneWayFlickToRight = true;
1657 var oneWayFlickToRight = true;
1684 var smallestX = gesturePoints[0]-1;
1658 var smallestX = gesturePoints[0]-1;
1685 for (var i = 0; i < gesturePoints.length; i++) {
1659 for (var i = 0; i < gesturePoints.length; i++) {
1686− print("have point:", gesturePoints[i])
1687 if (gesturePoints[i] <= smallestX) {
1660 if (gesturePoints[i] <= smallestX) {
1688 oneWayFlickToRight = false;
1661 oneWayFlickToRight = false;
@@ -1719,7 +1692,6 @@ AbstractStage {
1722− print("playing focus animation 1")
1723 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
1695 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
1724 } else {
1696 } else {
1725 cancelled = true;
1697 cancelled = true;
@@ -1741,11 +1713,9 @@ AbstractStage {
1741 dragComponentProperties: { "appDelegate": appDelegate }
1713 dragComponentProperties: { "appDelegate": appDelegate }
1743 onPressed: {
1715 onPressed: {
1744− print("********* triGestureArea pressed!")
1745 function matchDelegate(obj) { return String(obj.objectName).indexOf("appDelegate") >= 0; }
1716 function matchDelegate(obj) { return String(obj.objectName).indexOf("appDelegate") >= 0; }
1747 var delegateAtCenter = Functions.itemAt(appContainer, x, y, matchDelegate);
1718 var delegateAtCenter = Functions.itemAt(appContainer, x, y, matchDelegate);
1748− print("dragging delegate", delegateAtCenter)
1749 if (!delegateAtCenter) return;
1719 if (!delegateAtCenter) return;
1751 appDelegate = delegateAtCenter;
1721 appDelegate = delegateAtCenter;