on xenial help sign in
removed debug
commitde450aa2bb3d4429badf1cf02e126228d6b1a166 authorNick Dedekind <nick.dedekind@canonical.com> dateThu 6 Apr 2017, 13:57 (10 years ago) parente058685
12 files changed+1−397
qml/Shell.qml−2 qml/Stage/ApplicationWindow.qml−5 qml/Stage/Spread/ScreensAndWorkspaces.qml−1 qml/Stage/Spread/WorkspacePreview.qml−148 qml/Stage/Spread/Workspaces.qml+1−14 qml/Stage/Stage.qml−5 qml/Stage/SurfaceContainer.qml−2 qml/Stage/WorkspacePreview.qml−212 tests/qmltests/Stage/tst_PhoneStage.qml−1 tests/qmltests/Stage/tst_TabletStage.qml−5 tests/qmltests/tst_OrientedShell.qml−1 tests/qmltests/tst_Shell.qml−1
qml/Shell.qml−2
@@ -101,7 +101,6 @@ StyledItem {
101101 if (!WMScreen.currentWorkspace) return null;
102102 return stage.temporarySelectedWorkspace ? stage.temporarySelectedWorkspace.windowModel : WMScreen.currentWorkspace.windowModel
103103 }
104− onTopLevelSurfaceListChanged: print("********************** have new TLSL", topLevelSurfaceList)
105104
106105 onMainAppChanged: {
107106 if (mainApp) {
@@ -193,7 +192,6 @@ StyledItem {
193192 if (!ApplicationManager.findApplication(appId)) {
194193 ApplicationManager.startApplication(appId);
195194 }
196− print("focusing", appId)
197195 ApplicationManager.requestFocusApplication(appId);
198196 stage.closeSpread();
199197 }
qml/Stage/ApplicationWindow.qml−5
@@ -50,7 +50,6 @@ FocusScope {
5050 // transitions in stateGroup take place.
5151 // More specifically, the moment surfaceContainer.surface gets updated relative to the
5252 // other instructions.
53− print("AAA surface changed,", surface)
5453 if (surface) {
5554 surfaceContainer.surface = surface;
5655 surfaceInitTimer.start();
@@ -60,13 +59,9 @@ FocusScope {
6059 }
6160 }
6261
63− Component.onCompleted: print("AAA completed")
6462 QtObject {
6563 id: d
6664
67− onHadSurfaceChanged: print("AAA had surface changed,", hadSurface)
68− onSurfaceInitializedChanged: print("AAA surface initialized changed", surfaceInitialized)
69−
7065 // helpers so that we don't have to check for the existence of an application everywhere
7166 // (in order to avoid breaking qml binding due to a javascript exception)
7267 readonly property string name: root.application ? root.application.name : ""
qml/Stage/Spread/ScreensAndWorkspaces.qml−1
@@ -13,7 +13,6 @@ Item {
1313 property var screensProxy: Screens.createProxy();
1414
1515 property QtObject activeWorkspace: null
16− onActiveWorkspaceChanged: print("********************* active workspace changed:", activeWorkspace)
1716
1817 signal closeSpread();
1918
qml/Stage/Spread/WorkspacePreview.qml−148
@@ -60,7 +60,6 @@ Item {
6060 height: implicitHeight * previewScale
6161 surfaceWidth: -1
6262 surfaceHeight: -1
63− onImplicitHeightChanged: print("item", surfaceItem, "height changed", implicitHeight)
6463 surface: model.window.surface
6564 }
6665 }
@@ -126,150 +125,3 @@ Item {
126125 }
127126 }
128127}
129−
130− // Repeater {
131− // id: topLevelSurfaceRepeater
132− // model: visible ? topLevelSurfaceList : null
133− // delegate: Rectangle {
134− // width: surfaceItem.width
135− // height: surfaceItem.height + decorationHeight * previewScale
136− // x: model.window.position.x * previewScale
137− // y: (model.window.position.y - decorationHeight) * previewScale
138− // color: "blue"
139− // z: topLevelSurfaceRepeater.count - index
140−
141− // property int decorationHeight: units.gu(3)
142−
143− // WindowDecoration {
144− // width: surfaceItem.implicitWidth
145− // height: parent.decorationHeight
146− // transform: Scale {
147− // origin.x: 0
148− // origin.y: 0
149− // xScale: previewScale
150− // yScale: previewScale
151− // }
152− // title: model.window && model.window.surface ? model.window.surface.name : ""
153− // z: 3
154− // }
155−
156− // MirSurfaceItem {
157− // id: surfaceItem
158− // y: parent.decorationHeight * previewScale
159− // width: implicitWidth * previewScale
160− // height: implicitHeight * previewScale
161− // surfaceWidth: -1
162− // surfaceHeight: -1
163− // onImplicitHeightChanged: print("item", surfaceItem, "height changed", implicitHeight)
164− // surface: model.window.surface
165− // }
166− // }
167− // }
168−// }
169−// }
170−
171−
172−// MouseArea {
173−// id: mouseArea
174−// anchors.centerIn: parent
175−// anchors.verticalCenterOffset: header.height / 2
176−// width: units.gu(8)
177−// height: width
178−// hoverEnabled: true
179−// opacity: containsMouse ? 1 : 0
180−
181−// Rectangle {
182−// anchors.fill: parent
183−// color: "#80000000"
184−// radius: height / 2
185−// }
186−
187−// NumberAnimation {
188−// target: canvas
189−// property: "progress"
190−// duration: 2000
191−// running: mouseArea.containsMouse
192−// from: 0
193−// to: 1
194−// }
195−
196−// Canvas {
197−// id: canvas
198−// height: parent.height
199−// width: height
200−// anchors.centerIn: parent
201−
202−// property real progress: 0.5
203−// property int lineWidth: units.dp(4)
204−// onProgressChanged: {
205−// requestPaint();
206−// if (progress == 1) {
207−// Screens.activateScreen(index);
208−// }
209−// }
210−
211−// rotation: -90
212−
213−// onPaint: {
214−// var ctx = canvas.getContext("2d");
215−// ctx.save();
216−// ctx.reset();
217−
218−// ctx.lineWidth = lineWidth;
219−
220−// ctx.strokeStyle = "#3bffffff"
221−// ctx.beginPath();
222−// ctx.arc(canvas.width/2,canvas.height/2, (canvas.height - ctx.lineWidth) / 2, 0, (Math.PI*2),false);
223−// ctx.stroke();
224−// ctx.closePath();
225−
226−// ctx.strokeStyle = "white"
227−// ctx.beginPath();
228−// ctx.arc(canvas.width/2,canvas.height/2, (canvas.height - ctx.lineWidth) / 2, 0, (Math.PI*2*(progress)),false);
229−// ctx.stroke();
230−// ctx.closePath();
231−
232−// ctx.restore();
233−// }
234−// }
235−
236−// Icon {
237−// source: "graphics/multi-monitor_leave.png"
238−// height: units.gu(4)
239−// width: height
240−// anchors.centerIn: parent
241−// }
242−// }
243−// }
244−
245−// FloatingFlickable {
246−// id: flickable
247−// anchors.fill: parent
248−// contentWidth: workspaceRepeater.count * previewSpace.screenWidth * previewScale
249−// property real progress: contentX / contentWidth
250−// onContentXChanged: print("contentX:", contentX, "progress:", progress)
251−// }
252−
253−// MouseArea {
254−// anchors.fill: parent
255−// hoverEnabled: true
256−// property int scrollAreaWidth: width / 3
257−
258−// onMouseXChanged: {
259−// var margins = flickable.width * 0.05;
260−
261−// // do we need to scroll?
262−// if (mouseX < scrollAreaWidth + margins) {
263−// var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
264−// var contentX = (1 - progress) * (flickable.contentWidth - flickable.width)
265−// flickable.contentX = Math.max(0, Math.min(flickable.contentX, contentX))
266−// }
267−// if (mouseX > flickable.width - scrollAreaWidth) {
268−// var progress = Math.min(1, (mouseX - (flickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
269−// var contentX = progress * (flickable.contentWidth - flickable.width)
270−// flickable.contentX = Math.min(flickable.contentWidth - flickable.width, Math.max(flickable.contentX, contentX))
271−// }
272−// }
273−// }
274−// }
275−//}
qml/Stage/Spread/Workspaces.qml+1−14
@@ -116,13 +116,6 @@ Item {
116116 leftMargin: itemWidth
117117 rightMargin: itemWidth
118118
119− Connections {
120− target: screen
121− onAvailableModesChanged: {
122− print("blabla", screen.availableModes[screen.currentModeIndex].size.width, screen.availableModes[screen.currentModeIndex].size.height)
123− }
124− }
125−
126119 property int screenWidth: screen.availableModes[screen.currentModeIndex].size.width
127120 property int screenHeight: screen.availableModes[screen.currentModeIndex].size.height
128121 property int itemWidth: height * screenWidth / screenHeight
@@ -155,7 +148,6 @@ Item {
155148 var upperLimit = dropItemIndex == -1 ? listView.count : listView.count - 1
156149 if (index > upperLimit) index = upperLimit;
157150 listView.hoveredWorkspaceIndex = index;
158− print("updating drag:", (drag.x + listView.realContentX) % (listView.itemWidth + listView.spacing))
159151 var pixelsInTile = (drag.x + listView.realContentX) % (listView.itemWidth + listView.spacing);
160152 listView.hoveredHalf = (pixelsInTile / listView.itemWidth) < .5 ? "left" : "right";
161153 }
@@ -239,8 +231,6 @@ Item {
239231 return 0
240232 }
241233
242− // onItemXChanged: if (index == 1) print("x", itemX, listView.contentX)
243−
244234 z: itemOffset < 0 ? itemOffset : -itemOffset
245235 transform: [
246236 Rotation {
@@ -347,11 +337,8 @@ Item {
347337 property bool dragging: drag.active
348338 onDraggingChanged: {
349339 if (drag.active) {
350− print("drai", draggedIndex)
351340 var ws = listView.model.get(draggedIndex);
352− print("ws:", ws)
353− ws.unassign();
354− // listView.model.remove(draggedIndex, 1)
341+ if (ws) ws.unassign();
355342 }
356343 }
357344
qml/Stage/Stage.qml−5
@@ -573,14 +573,12 @@ FocusScope {
573573 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
574574 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
575575 PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
576− ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
577576 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
578577 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
579578 },
580579 Transition {
581580 to: "spread"
582581 PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
583− ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
584582 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
585583 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
586584 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
@@ -1680,9 +1678,6 @@ FocusScope {
16801678 }
16811679 }
16821680 ]
1683− onStateChanged: {
1684− print("item", index, "state changed", state)
1685− }
16861681
16871682 transitions: [
16881683 Transition {
qml/Stage/SurfaceContainer.qml−2
@@ -66,8 +66,6 @@ FocusScope {
6666 fillMode: MirSurfaceItem.PadOrCrop
6767 consumesInput: true
6868
69− onSurfaceChanged: print("surface changed", surface, implicitWidth, implicitHeight)
70−
7169 surfaceWidth: root.requestedWidth
7270 surfaceHeight: root.requestedHeight
7371
qml/Stage/WorkspacePreview.qmldeleted−212
@@ -1,212 +0,0 @@
1−import QtQuick 2.4
2−import Ubuntu.Components 1.3
3−import Unity.Screens 0.1
4−import Unity.Application 0.1
5−import "../Components"
6−
7−UbuntuShape {
8− id: previewSpace
9−
10− // Set the height. this preview will then automatically adjust the width, keeping aspect ratio of the screen
11− width: model.geometry.width * previewScale * 4
12− color: "white"
13− property string background
14−
15− property int screenWidth: model.geometry.width
16− property int screenHeight: model.geometry.height
17− property real previewScale: (previewSpace.height - header.height) / previewSpace.screenHeight
18−
19− Item {
20− id: header
21− anchors { left: parent.left; top: parent.top; right: parent.right }
22− height: units.gu(7)
23−
24− Column {
25− anchors.fill: parent
26− anchors.margins: units.gu(1)
27−
28− Label {
29− text: model.name
30− color: "black"
31− }
32−
33− Label {
34− text: model.outputType === Screens.LVDS ? "Built-in" : "Clone"
35− color: "black"
36− fontSize: "x-small"
37− }
38−
39− Label {
40− text: model.geometry.width + "x" + model.geometry.height
41− color: "black"
42− fontSize: "x-small"
43− }
44− }
45− }
46−
47−
48− Rectangle {
49− anchors.fill: parent
50− anchors.topMargin: header.height
51− color: "blue"
52−
53− Repeater {
54− id: workspaceRepeater
55− model: 15
56−
57− delegate: Item {
58− x: index * previewSpace.screenWidth * previewScale
59− height: previewSpace.screenHeight * previewScale
60− width: previewSpace.screenWidth * previewScale
61− clip: true
62−
63− Wallpaper {
64− source: previewSpace.background
65− anchors.fill: parent
66−
67− // Repeater {
68− // id: topLevelSurfaceRepeater
69− // model: visible ? topLevelSurfaceList : null
70− // delegate: Rectangle {
71− // width: surfaceItem.width
72− // height: surfaceItem.height + decorationHeight * previewScale
73− // x: model.window.position.x * previewScale
74− // y: (model.window.position.y - decorationHeight) * previewScale
75− // color: "blue"
76− // z: topLevelSurfaceRepeater.count - index
77−
78− // property int decorationHeight: units.gu(3)
79−
80− // WindowDecoration {
81− // width: surfaceItem.implicitWidth
82− // height: parent.decorationHeight
83− // transform: Scale {
84− // origin.x: 0
85− // origin.y: 0
86− // xScale: previewScale
87− // yScale: previewScale
88− // }
89− // title: model.window && model.window.surface ? model.window.surface.name : ""
90− // z: 3
91− // }
92−
93− // MirSurfaceItem {
94− // id: surfaceItem
95− // y: parent.decorationHeight * previewScale
96− // width: implicitWidth * previewScale
97− // height: implicitHeight * previewScale
98− // surfaceWidth: -1
99− // surfaceHeight: -1
100− // onImplicitHeightChanged: print("item", surfaceItem, "height changed", implicitHeight)
101− // surface: model.window.surface
102− // }
103− // }
104− // }
105− }
106− }
107−
108−
109−// MouseArea {
110−// id: mouseArea
111−// anchors.centerIn: parent
112−// anchors.verticalCenterOffset: header.height / 2
113−// width: units.gu(8)
114−// height: width
115−// hoverEnabled: true
116−// opacity: containsMouse ? 1 : 0
117−
118−// Rectangle {
119−// anchors.fill: parent
120−// color: "#80000000"
121−// radius: height / 2
122−// }
123−
124−// NumberAnimation {
125−// target: canvas
126−// property: "progress"
127−// duration: 2000
128−// running: mouseArea.containsMouse
129−// from: 0
130−// to: 1
131−// }
132−
133−// Canvas {
134−// id: canvas
135−// height: parent.height
136−// width: height
137−// anchors.centerIn: parent
138−
139−// property real progress: 0.5
140−// property int lineWidth: units.dp(4)
141−// onProgressChanged: {
142−// requestPaint();
143−// if (progress == 1) {
144−// Screens.activateScreen(index);
145−// }
146−// }
147−
148−// rotation: -90
149−
150−// onPaint: {
151−// var ctx = canvas.getContext("2d");
152−// ctx.save();
153−// ctx.reset();
154−
155−// ctx.lineWidth = lineWidth;
156−
157−// ctx.strokeStyle = "#3bffffff"
158−// ctx.beginPath();
159−// ctx.arc(canvas.width/2,canvas.height/2, (canvas.height - ctx.lineWidth) / 2, 0, (Math.PI*2),false);
160−// ctx.stroke();
161−// ctx.closePath();
162−
163−// ctx.strokeStyle = "white"
164−// ctx.beginPath();
165−// ctx.arc(canvas.width/2,canvas.height/2, (canvas.height - ctx.lineWidth) / 2, 0, (Math.PI*2*(progress)),false);
166−// ctx.stroke();
167−// ctx.closePath();
168−
169−// ctx.restore();
170−// }
171−// }
172−
173−// Icon {
174−// source: "graphics/multi-monitor_leave.png"
175−// height: units.gu(4)
176−// width: height
177−// anchors.centerIn: parent
178−// }
179−// }
180− }
181−
182− FloatingFlickable {
183− id: flickable
184− anchors.fill: parent
185− contentWidth: workspaceRepeater.count * previewSpace.screenWidth * previewScale
186− property real progress: contentX / contentWidth
187− onContentXChanged: print("contentX:", contentX, "progress:", progress)
188− }
189−
190− MouseArea {
191− anchors.fill: parent
192− hoverEnabled: true
193− property int scrollAreaWidth: width / 3
194−
195− onMouseXChanged: {
196− var margins = flickable.width * 0.05;
197−
198− // do we need to scroll?
199− if (mouseX < scrollAreaWidth + margins) {
200− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
201− var contentX = (1 - progress) * (flickable.contentWidth - flickable.width)
202− flickable.contentX = Math.max(0, Math.min(flickable.contentX, contentX))
203− }
204− if (mouseX > flickable.width - scrollAreaWidth) {
205− var progress = Math.min(1, (mouseX - (flickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
206− var contentX = progress * (flickable.contentWidth - flickable.width)
207− flickable.contentX = Math.min(flickable.contentWidth - flickable.width, Math.max(flickable.contentX, contentX))
208− }
209− }
210− }
211− }
212−}
tests/qmltests/Stage/tst_PhoneStage.qml−1
@@ -304,7 +304,6 @@ Item {
304304
305305 performEdgeSwipeToShowAppSpread();
306306
307− print("tapping", selectedAppDeleage.appId, selectedAppDeleage.visible)
308307 if (selectedAppDeleage.x > stage.width - units.gu(5)) {
309308 touchFlick(stage, stage.width - units.gu(2), stage.height / 2, units.gu(2), stage.height / 2, true, true, units.gu(2), 10)
310309 }
tests/qmltests/Stage/tst_TabletStage.qml−5
@@ -66,7 +66,6 @@ Rectangle {
6666 }
6767
6868 Component.onCompleted: {
69− print("starting dash")
7069 ApplicationManager.startApplication("unity8-dash");
7170 }
7271 }
@@ -143,10 +142,8 @@ Rectangle {
143142 function init() {
144143 stageSaver.clear();
145144
146− print("blllaaaaaaaaa")
147145 ApplicationManager.startApplication("unity8-dash");
148146 tryCompare(topLevelSurfaceList, "count", 1);
149− print("have", topLevelSurfaceList.count, "surfaces")
150147 compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
151148
152149 // this is very strange, but sometimes the test starts without
@@ -168,7 +165,6 @@ Rectangle {
168165 waitUntilAppSurfaceShowsUp(topLevelSurfaceList.idAt(0));
169166 sideStage.hideNow()
170167 tryCompare(sideStage, "x", stage.width)
171− print("still have", topLevelSurfaceList.count, "surfaces")
172168
173169 }
174170
@@ -602,7 +598,6 @@ Rectangle {
602598
603599 function test_loadSideStageByDraggingFromMainStage() {
604600 sideStage.showNow();
605− print("sidestage now shown. launching browser")
606601 var webbrowserSurfaceId = topLevelSurfaceList.nextId;
607602 webbrowserCheckBox.checked = true;
608603 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
tests/qmltests/tst_OrientedShell.qml−1
@@ -1521,7 +1521,6 @@ Rectangle {
15211521 }
15221522 var point = surfaceItem.mapToItem(orientedShell, 0, 0);
15231523
1524− print("exptectedAngle", expectedAngle, point.x, point.y)
15251524 switch (expectedAngle) {
15261525 case 0:
15271526 return point.x === 0 && point.y === panelState.panelHeight;
tests/qmltests/tst_Shell.qml−1
@@ -2708,7 +2708,6 @@ Rectangle {
27082708 dashAppDelegate.windowedY = data.windowY;
27092709 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
27102710 var initialY = dashAppDelegate.y;
2711− print("intial", initialY, "panel", panelState.panelHeight);
27122711 verify(initialY > panelState.panelHeight);
27132712
27142713 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));