on xenial help sign in
drop tons of debug prints
commit3846937d401554b2113561496d82f66e54c4e698 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 13 Sep 2016, 13:53 (10 years ago) parentaaee5f4
11 files changed+2−66
qml/Stage/FakeMaximizeDelegate.qml−2 qml/Stage/PromptSurfaceAnimations.qml−1 qml/Stage/Spread/Spread.qml−11 qml/Stage/Spread/SpreadDelegateInputArea.qml−4 qml/Stage/Spread/StagedRightEdgeMaths.qml−2 qml/Stage/Stage.qml−30 qml/Stage/StageMaths.qml−2 qml/Stage/SurfaceContainer.qml−1 qml/Stage/WindowControlsOverlay.qml−4 qml/Stage/WindowResizeArea.qml−1 tests/qmltests/tst_Shell.qml+2−8
qml/Stage/FakeMaximizeDelegate.qml−2
@@ -38,7 +38,6 @@ Rectangle {
3838
3939 readonly property real hintThreshold: 0.1
4040
41− onEdgeChanged: print("***********+ edge changed", edge)
4241 // Edge push progress
4342 // Value range is [0.0, 1.0]
4443 readonly property real progress: priv.directProgress != -1 ? priv.directProgress : priv.accumulatedProgress
@@ -97,7 +96,6 @@ Rectangle {
9796 }
9897
9998 function commit() {
100− print("comitting!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
10199 if (progress > hintThreshold && edge != -1) {
102100 if (edge == Item.Top) {
103101 target.maximize();
qml/Stage/PromptSurfaceAnimations.qml−1
@@ -22,7 +22,6 @@ StateGroup {
2222 property var container
2323 property var surfaceItem
2424
25− onStateChanged: print("++++++++++++++++++++++++ surface animation state change", state)
2625 states: [
2726 State {
2827 name: "blank"
qml/Stage/Spread/Spread.qml−11
@@ -101,18 +101,7 @@ Item {
101101 Behavior on opacity { UbuntuNumberAnimation { } }
102102 }
103103
104−// Label {
105−// anchors { left: parent.left; top: parent.top; margins: units.gu(4) }
106−// text: "spreadWidth: " + spreadWidth
107−// + "\n spreadItemWidth: " + spreadItemWidth
108−// + "\n flickableContentWidth: " + spreadTotalWidth
109−// + "\n visibleItemCount: " + visibleItemCount
110−// + "\n contentTopMargin: " + contentTopMargin
111−// }
112−
113−
114104 Keys.onPressed: {
115− print("key pressed")
116105 switch (event.key) {
117106 case Qt.Key_Left:
118107 case Qt.Key_Backtab:
qml/Stage/Spread/SpreadDelegateInputArea.qml−4
@@ -51,7 +51,6 @@ Item {
5151 for (var i = 0; i < dragEvents.length; i++) {
5252 totalSpeed += dragEvents[i][3]
5353 }
54− print("total speed", totalSpeed)
5554
5655 if (zeroVelocityCounts || Math.abs(totalSpeed) > 0.001) {
5756 dragVelocity = totalSpeed / dragEvents.length * 1000
@@ -105,11 +104,9 @@ Item {
105104
106105 d.distance = tp.y - tp.startY - offset
107106 d.pushDragEvent(tp);
108− print("pushed event", tp.y, "velocity is now", d.dragVelocity)
109107 }
110108
111109 onReleased: {
112− print("released", d.moving)
113110 if (!d.moving) {
114111 root.clicked()
115112 }
@@ -121,7 +118,6 @@ Item {
121118
122119 var touchPoint = touchPoints[0];
123120
124− print("released velocity is", d.dragVelocity, "min velocity", root.minSpeedToClose)
125121 if ((d.dragVelocity < -root.minSpeedToClose && d.distance < -units.gu(8)) || d.distance < -root.height / 2) {
126122 animation.animate("up")
127123 } else if ((d.dragVelocity > root.minSpeedToClose && d.distance > units.gu(8)) || d.distance > root.height / 2) {
qml/Stage/Spread/StagedRightEdgeMaths.qml−2
@@ -131,8 +131,6 @@ QtObject {
131131 startScale = root.startScale;
132132 }
133133
134−// print("main stage delegate:", priv.mainStageDelegate, "side delegate", priv.sideStageDelegate, "this", appDelegate, "scale:", startScale)
135−// return startScale;
136134 if (itemIndex == nextInStack) {
137135 return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
138136 }
qml/Stage/Stage.qml−30
@@ -179,7 +179,6 @@ AbstractStage {
179179 for (var i = 0; i < appRepeater.count; i++) {
180180 var appDelegate = appRepeater.itemAt(i);
181181 if (appDelegate && !appDelegate.minimized) {
182− print("***** focusing because of focusNext() call", appDelegate.application.appId)
183182 appDelegate.focus = true;
184183 return;
185184 }
@@ -402,9 +401,7 @@ AbstractStage {
402401 SequentialAnimation {
403402 ScriptAction {
404403 script: {
405− print("hightedIndex is:", spreadItem.highlightedIndex)
406404 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
407− print("playing focus animation 3 on item", spreadItem.highlightedIndex, item.application.appId)
408405
409406 item.playFocusAnimation();
410407 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -475,7 +472,6 @@ AbstractStage {
475472 enabled: sideStage.enabled
476473
477474 onDropped: {
478− print("dropped on main stage drop area")
479475 drop.source.appDelegate.saveStage(ApplicationInfoInterface.MainStage);
480476 drop.source.appDelegate.focus = true;
481477 }
@@ -526,7 +522,6 @@ AbstractStage {
526522 onDropped: {
527523 if (drop.keys == "MainStage") {
528524 drop.source.appDelegate.saveStage(ApplicationInfoInterface.SideStage);
529− print("dropped on mainstage")
530525 drop.source.appDelegate.focus = true;
531526 }
532527 }
@@ -676,7 +671,6 @@ AbstractStage {
676671 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem
677672
678673 function claimFocus() {
679− print("(claimfocus) focusing app", priv.sideStageDelegate, appDelegate, sideStage.shown)
680674 if (root.state == "spread") {
681675 priv.goneToSpread = false;
682676 }
@@ -695,7 +689,6 @@ AbstractStage {
695689 onFocusRequested: {
696690 // Reset spread selection in case there is any
697691 spreadItem.highlightedIndex = -1
698− print("claiming focus 3")
699692 claimFocus();
700693 }
701694 }
@@ -705,7 +698,6 @@ AbstractStage {
705698 if (!model.surface) {
706699 // when an app has no surfaces, we assume there's only one entry representing it:
707700 // this delegate.
708− print("claiming focus 4")
709701 claimFocus();
710702 } else {
711703 // if the application has surfaces, focus request should be at surface-level.
@@ -738,7 +730,6 @@ AbstractStage {
738730 if (!appRepeater.startingUp) {
739731 // a top level window is always the focused one when it first appears, unfocusing
740732 // any preexisting one
741− print("focusing because of creation")
742733 focus = true;
743734 }
744735
@@ -760,7 +751,6 @@ AbstractStage {
760751 for (var i = 0; i < appRepeater.count; i++) {
761752 var appDelegate = appRepeater.itemAt(i);
762753 if (appDelegate && !appDelegate.minimized && i != index) {
763− print("focusing some other because of destruction")
764754 appDelegate.focus = true;
765755 return;
766756 }
@@ -837,24 +827,20 @@ AbstractStage {
837827 animationsEnabled = (animated === undefined) || animated;
838828 windowState = state || WindowStateStorage.WindowStateRestored;
839829 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
840− print("***** focusing because of window restore", model.application.appId)
841830 focus = true;
842831 }
843832
844833 function playFocusAnimation() {
845− print("playing focus animation", state, root.mode, "app", model.application.appId)
846834 if (state == "stagedRightEdge") {
847835 // TODO: Can we drop this if and find something that always works?
848836 if (root.mode == "staged") {
849837 rightEdgeFocusAnimation.targetX = 0
850− print("doing it to 0")
851838 rightEdgeFocusAnimation.start()
852839 } else if (root.mode == "stagedWithSideStage") {
853840 rightEdgeFocusAnimation.targetX = appDelegate.stage == ApplicationInfoInterface.SideStage ? sideStage.x : 0
854841 rightEdgeFocusAnimation.start()
855842 }
856843 } else if (state == "windowedRightEdge" || root.mode == "windowed") {
857− print("claiming focus 1")
858844 claimFocus();
859845 } else {
860846 focusAnimation.start()
@@ -893,29 +879,24 @@ AbstractStage {
893879 to: 1
894880 duration: UbuntuAnimation.SnapDuration
895881 onStarted: {
896− print("starting focusanimation for", model.application.appId)
897882 topLevelSurfaceList.raiseId(model.id);
898883 }
899884 onStopped: {
900− print("focusing because of normal focus animation finishing")
901885 appDelegate.focus = true
902886 }
903887 }
904888 ParallelAnimation {
905889 id: rightEdgeFocusAnimation
906890 property int targetX: 0
907− onStarted: print("starting rightedgefocusanimation for", model.application.appId)
908891 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: rightEdgeFocusAnimation.targetX; duration: priv.animationDuration }
909892 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
910893 UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
911894 onStopped: {
912− print("focusing", model.application.appId, "because of right edge focus animation completion");
913895 appDelegate.focus = true
914896 }
915897 }
916898 ParallelAnimation {
917899 id: hidingAnimation
918− onStarted: print("starting hiding animation for", model.application.appId)
919900 UbuntuNumberAnimation { target: appDelegate; property: "opacity"; to: 0; duration: priv.animationDuration }
920901 onStopped: appDelegate.opacity = 1
921902 }
@@ -1303,14 +1284,10 @@ AbstractStage {
13031284 windowedRightEdgeMaths.startY = appDelegate.requestedY
13041285
13051286 if (index == 1) {
1306− print("should calculate overlap from", model.application.appId, "with", appRepeater.itemAt(0).application.appId)
13071287 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)
13091288 var otherDelegate = appRepeater.itemAt(0);
13101289 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)
13121290 var intersectionRect = MathUtils.intersectionRect(thisRect, otherRect)
1313− print("intersection is", intersectionRect.x, intersectionRect.y, intersectionRect.width, intersectionRect.height)
13141291 var mappedInterSectionRect = appDelegate.mapFromItem(root, intersectionRect.x, intersectionRect.y)
13151292 opacityEffect.maskX = mappedInterSectionRect.x
13161293 opacityEffect.maskY = mappedInterSectionRect.y
@@ -1369,7 +1346,6 @@ AbstractStage {
13691346 visible: enabled
13701347
13711348 onPressed: {
1372− print("***** focusing because of resize area press", model.application.appId)
13731349 appDelegate.focus = true;
13741350 }
13751351
@@ -1482,7 +1458,6 @@ AbstractStage {
14821458
14831459 onClicked: {
14841460 spreadItem.highlightedIndex = index;
1485− print("*****************setting highlighted index to:", index, appRepeater.itemAt(index))
14861461 if (distance == 0) {
14871462 priv.goneToSpread = false;
14881463 }
@@ -1669,7 +1644,6 @@ AbstractStage {
16691644 }
16701645
16711646 onDraggingChanged: {
1672− print("dda dragging changed", dragging)
16731647 if (dragging) {
16741648 // A potential edge-drag gesture has started. Start recording it
16751649 gesturePoints = [];
@@ -1683,7 +1657,6 @@ AbstractStage {
16831657 var oneWayFlickToRight = true;
16841658 var smallestX = gesturePoints[0]-1;
16851659 for (var i = 0; i < gesturePoints.length; i++) {
1686− print("have point:", gesturePoints[i])
16871660 if (gesturePoints[i] <= smallestX) {
16881661 oneWayFlickToRight = false;
16891662 break;
@@ -1719,7 +1692,6 @@ AbstractStage {
17191692 break;
17201693 }
17211694 }
1722− print("playing focus animation 1")
17231695 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
17241696 } else {
17251697 cancelled = true;
@@ -1741,11 +1713,9 @@ AbstractStage {
17411713 dragComponentProperties: { "appDelegate": appDelegate }
17421714
17431715 onPressed: {
1744− print("********* triGestureArea pressed!")
17451716 function matchDelegate(obj) { return String(obj.objectName).indexOf("appDelegate") >= 0; }
17461717
17471718 var delegateAtCenter = Functions.itemAt(appContainer, x, y, matchDelegate);
1748− print("dragging delegate", delegateAtCenter)
17491719 if (!delegateAtCenter) return;
17501720
17511721 appDelegate = delegateAtCenter;
qml/Stage/StageMaths.qml−2
@@ -38,7 +38,6 @@ QtObject {
3838 return 0;
3939 }
4040
41− print("App:", model.application.appId, "index:", itemIndex, "nextInStack:", nextInStack)
4241 if (nextInStack > 0) {
4342 var stageOfNextInStack = appRepeater.itemAt(nextInStack).stage;
4443
@@ -55,7 +54,6 @@ QtObject {
5554 // if the next app in stack is a sidestage app, it must order on top of other side stage app
5655 return 1;
5756 }
58− print("returning", Math.min(2, topLevelSurfaceList.count-1), topLevelSurfaceList.count)
5957 return Math.min(2, topLevelSurfaceList.count-1);
6058 }
6159 return Math.min(index+1, topLevelSurfaceList.count-1);
qml/Stage/SurfaceContainer.qml−1
@@ -114,7 +114,6 @@ FocusScope {
114114 objectName: "animationsLoader"
115115 active: root.surface
116116 source: {
117− print("++++++++++++++++++++++++++++++++++++++++++++ loading animation!!!", root.isPromptSurface, surfaceItem, root)
118117 if (root.isPromptSurface) {
119118 return "PromptSurfaceAnimations.qml";
120119 } else {
qml/Stage/WindowControlsOverlay.qml−4
@@ -86,10 +86,6 @@ Item {
8686 id: overlayTimer
8787 interval: 2000
8888 repeat: priv.dragging
89− onTriggered: {
90− print("timer triggered")
91− }
92− onRunningChanged: print("timer running changed", running)
9389 }
9490
9591 QtObject {
qml/Stage/WindowResizeArea.qml−1
@@ -78,7 +78,6 @@ MouseArea {
7878 Qt.rect(target.windowedX, target.windowedY, defaultWidth, defaultHeight));
7979
8080
81− print("loading Window state!", root.windowId, windowGeometry.width, windowGeometry.height)
8281 target.windowedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
8382 target.windowedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
8483 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
tests/qmltests/tst_Shell.qml+2−8
@@ -206,7 +206,7 @@ Rectangle {
206206 childs.push(shellLoader.item)
207207 while (childs.length > 0) {
208208 if (childs[0].activeFocus && childs[0].focus && childs[0].objectName != "shell") {
209− print("Active focus is on item:", childs[0]);
209+ console.log("Active focus is on item:", childs[0]);
210210 return;
211211 }
212212 for (var i in childs[0].children) {
@@ -214,7 +214,7 @@ Rectangle {
214214 }
215215 childs.splice(0, 1);
216216 }
217− print("No active focused item found within shell.")
217+ console.log("No active focused item found within shell.")
218218 }
219219 }
220220 }
@@ -243,9 +243,7 @@ Rectangle {
243243 activeFocusOnPress: false
244244 model: ["phone", "tablet", "desktop"]
245245 onSelectedIndexChanged: {
246−// shellLoader.active = false;
247246 shellLoader.state = model[selectedIndex];
248−// shellLoader.active = true;
249247 }
250248 }
251249 Label {
@@ -1855,12 +1853,10 @@ Rectangle {
18551853 var y = shell.height * (data.tileInfo ? .9 : 0.5)
18561854 mouseMove(shell, x, y)
18571855 while (spreadItem.highlightedIndex !== 2 && x <= 4000) {
1858− print("hightlight", spreadItem.highlightedIndex, x, y)
18591856 x+=10;
18601857 mouseMove(shell, x, y)
18611858 wait(0); // spin the loop so bindings get evaluated
18621859 }
1863− print("hightlight", spreadItem.highlightedIndex)
18641860 tryCompare(decoratedWindow, "showHighlight", true);
18651861
18661862 // Click the tile
@@ -1868,7 +1864,6 @@ Rectangle {
18681864
18691865 // Verify that we left the spread and app2 is the focused one now
18701866 tryCompare(stage, "state", "windowed");
1871− print("selected:", surface.name)
18721867 tryCompare(surface, "focused", true);
18731868
18741869 keyRelease(Qt.Key_Alt);
@@ -2374,7 +2369,6 @@ Rectangle {
23742369 tryCompare(launcherPanel, "x", 0)
23752370 waitForRendering(shell)
23762371 var shownSize = appDelegate.width;
2377− print("launcher size:", launcher.panelWidth, "hidden:", hiddenSize, "shown:", shownSize)
23782372
23792373 compare(shownSize + launcher.panelWidth, hiddenSize);
23802374 }