on xenial help sign in
drop prints()s in StageWithSideStage
4c313deMichael Zanetti
qml/Stages/StageWithSideStage.qml−33
@@ -38,18 +38,13 @@ Item {
38
38
39 readonly property int overlayWidth: priv.overlayOverride ? 0 : priv.sideStageWidth
39 readonly property int overlayWidth: priv.overlayOverride ? 0 : priv.sideStageWidth
40
40
41− onPaintingChanged: print(":::::::::::::::::::::::::::::::: painting changed:", painting, "overlayMode:", overlayMode)
42− onOverlayModeChanged: print(";;;;;;;;;;;;;;;;;;;;;;;;;; overlayModeChanged:", overlayWidth)
43−
44 onShownChanged: {
41 onShownChanged: {
45− print("___________________________shown", shown)
46 if (!shown) {
42 if (!shown) {
47 priv.mainStageAppId = "";
43 priv.mainStageAppId = "";
48 }
44 }
49 }
45 }
50
46
51 onMovingChanged: {
47 onMovingChanged: {
52− print("moving", moving, priv.haveMainStageApp, priv.haveSideStageApp)
53 if (moving) {
48 if (moving) {
54 if (!priv.mainStageAppId && !priv.sideStageAppId) {
49 if (!priv.mainStageAppId && !priv.sideStageAppId) {
55 // Pulling in from the right, make the last used (topmost) app visible
50 // Pulling in from the right, make the last used (topmost) app visible
@@ -122,26 +117,21 @@ Item {
122 }
117 }
123 }
118 }
124 }
119 }
125− print("focused app changed", focusedApplicationId, mainStageAppId, sideStageAppId, sideStageImage.shown, priv.startingAppId)
126 }
120 }
127
121
128 onMainStageScreenshotChanged: {
122 onMainStageScreenshotChanged: {
129− print("------------------------------------------0")
130 waitingForMainScreenshot = false;
123 waitingForMainScreenshot = false;
131 }
124 }
132
125
133 onSideStageScreenshotChanged: {
126 onSideStageScreenshotChanged: {
134− print("------------------------------------------1")
135 waitingForSideScreenshot = false;
127 waitingForSideScreenshot = false;
136 }
128 }
137
129
138 onFocusedScreenshotChanged: {
130 onFocusedScreenshotChanged: {
139− print("##########################################", root.overlayMode)
140 waitingForSideScreenshot = false;
131 waitingForSideScreenshot = false;
141 }
132 }
142
133
143 onWaitingForScreenshotsChanged: {
134 onWaitingForScreenshotsChanged: {
144− print("********************++ waitingForScreenshotsChanged:", waitingForScreenshots);
145 if (waitingForScreenshots) {
135 if (waitingForScreenshots) {
146 return;
136 return;
147 }
137 }
@@ -154,16 +144,13 @@ Item {
154 if (sideStageAppId && focusedApplicationId == sideStageAppId) {
144 if (sideStageAppId && focusedApplicationId == sideStageAppId) {
155 sideStageImage.application = sideStageApp;
145 sideStageImage.application = sideStageApp;
156 sideStageImage.x = root.width - sideStageImage.width
146 sideStageImage.x = root.width - sideStageImage.width
157− print("setting side stage screenshot visiblr")
158 sideStageImage.visible = true;
147 sideStageImage.visible = true;
159 }
148 }
160 }
149 }
161 if (sideStageHandleMouseArea.pressed) {
150 if (sideStageHandleMouseArea.pressed) {
162 if (sideStageAppId) {
151 if (sideStageAppId) {
163− print("setting side stage screenshot to", sideStageAppId)
164 sideStageImage.application = sideStageApp;
152 sideStageImage.application = sideStageApp;
165 sideStageImage.x = root.width - sideStageImage.width
153 sideStageImage.x = root.width - sideStageImage.width
166− print("setting side stage screenshot visiblr")
167 sideStageImage.visible = true;
154 sideStageImage.visible = true;
168 }
155 }
169 if (mainStageAppId) {
156 if (mainStageAppId) {
@@ -174,13 +161,10 @@ Item {
174 }
161 }
175
162
176 function requestNewScreenshot(stage) {
163 function requestNewScreenshot(stage) {
177− print("** requestNewScreenshot called for stage", stage, mainStageAppId, sideStageAppId)
178 if (stage == ApplicationInfoInterface.MainStage && mainStageAppId) {
164 if (stage == ApplicationInfoInterface.MainStage && mainStageAppId) {
179− print("requesting new MainStage screenshot")
180 waitingForMainScreenshot = true;
165 waitingForMainScreenshot = true;
181 ApplicationManager.updateScreenshot(mainStageAppId);
166 ApplicationManager.updateScreenshot(mainStageAppId);
182 } else if (stage == ApplicationInfoInterface.SideStage && sideStageAppId) {
167 } else if (stage == ApplicationInfoInterface.SideStage && sideStageAppId) {
183− print("requesting new SideStage screenshot")
184 waitingForSideScreenshot = true;
168 waitingForSideScreenshot = true;
185 ApplicationManager.updateScreenshot(sideStageAppId);
169 ApplicationManager.updateScreenshot(sideStageAppId);
186 }
170 }
@@ -217,8 +201,6 @@ Item {
217 }
201 }
218
202
219 onFocusRequested: {
203 onFocusRequested: {
220− print("focus requested by", appId)
221−
222 var application = ApplicationManager.findApplication(appId)
204 var application = ApplicationManager.findApplication(appId)
223 if (application.stage == ApplicationInfoInterface.SideStage) {
205 if (application.stage == ApplicationInfoInterface.SideStage) {
224 if (!root.shown) {
206 if (!root.shown) {
@@ -226,7 +208,6 @@ Item {
226 mainStageImage.application = null
208 mainStageImage.application = null
227 }
209 }
228 if (sideStageImage.shown) {
210 if (sideStageImage.shown) {
229− print("switching to:", appId)
230 sideStageImage.switchTo(application)
211 sideStageImage.switchTo(application)
231 mainStageImage.visible = true;
212 mainStageImage.visible = true;
232 ApplicationManager.focusApplication(appId)
213 ApplicationManager.focusApplication(appId)
@@ -235,16 +216,12 @@ Item {
235 sideStageImage.snapToApp(application)
216 sideStageImage.snapToApp(application)
236 }
217 }
237 } else if (application.stage == ApplicationInfoInterface.MainStage) {
218 } else if (application.stage == ApplicationInfoInterface.MainStage) {
238− print("should focus a main stage app")
239 if (root.shown) {
219 if (root.shown) {
240− print("root is already shown")
241 priv.mainStageAppId = application.appId;
220 priv.mainStageAppId = application.appId;
242 mainStageImage.switchTo(application)
221 mainStageImage.switchTo(application)
243 if (sideStageImage.shown) {
222 if (sideStageImage.shown) {
244− print("hiding side stage!")
245 sideStageImage.snapTo(root.width)
223 sideStageImage.snapTo(root.width)
246 } else {
224 } else {
247− print("focusing app", appId)
248 ApplicationManager.focusApplication(appId)
225 ApplicationManager.focusApplication(appId)
249 }
226 }
250 } else {
227 } else {
@@ -301,7 +278,6 @@ Item {
301 property var dragPoints: new Array()
278 property var dragPoints: new Array()
302
279
303 onPressed: {
280 onPressed: {
304− print("sidestagehandle pressed. shown:", shown, "sidestageAppId:", priv.sideStageAppId)
305 priv.requestNewScreenshot(ApplicationInfoInterface.SideStage)
281 priv.requestNewScreenshot(ApplicationInfoInterface.SideStage)
306 if (priv.mainStageAppId) {
282 if (priv.mainStageAppId) {
307 priv.requestNewScreenshot(ApplicationInfoInterface.MainStage)
283 priv.requestNewScreenshot(ApplicationInfoInterface.MainStage)
@@ -310,7 +286,6 @@ Item {
310
286
311 onMouseXChanged: {
287 onMouseXChanged: {
312 dragPoints.push(mouseX)
288 dragPoints.push(mouseX)
313− print("mouseX changed. waiting for screenshots", priv.waitingForScreenshots)
314// if (priv.waitingForScreenshots) {
289// if (priv.waitingForScreenshots) {
315// return;
290// return;
316// }
291// }
@@ -338,7 +313,6 @@ Item {
338 if (oneWayFlick || distance > sideStageImage.width / 2) {
313 if (oneWayFlick || distance > sideStageImage.width / 2) {
339 sideStageImage.snapTo(root.width)
314 sideStageImage.snapTo(root.width)
340 } else {
315 } else {
341− print("should snap to:", priv.sideStageAppId)
342 sideStageImage.snapToApp(priv.sideStageApp)
316 sideStageImage.snapToApp(priv.sideStageApp)
343 }
317 }
344 }
318 }
@@ -362,7 +336,6 @@ Item {
362 }
336 }
363
337
364 function snapTo(targetX) {
338 function snapTo(targetX) {
365−// print("snapping to... app:", sideStageImage.application.appId)
366 sideStageSnapAnimation.targetX = targetX
339 sideStageSnapAnimation.targetX = targetX
367 sideStageImage.visible = true;
340 sideStageImage.visible = true;
368 if (priv.mainStageAppId) {
341 if (priv.mainStageAppId) {
@@ -383,8 +356,6 @@ Item {
383 property int targetX: root.width
356 property int targetX: root.width
384 property string snapToId
357 property string snapToId
385
358
386− onRunningChanged: print("sideStageSnapAnimation running changed:", running, sideStageImage.visible, mainStageImage.visible, root.painting, mainStageImage.visible || sideStageImage.visible || sideStageSnapAnimation.running)
387−
388 UbuntuNumberAnimation { target: sideStageImage; property: "x"; to: sideStageSnapAnimation.targetX; duration: UbuntuAnimation.SlowDuration }
359 UbuntuNumberAnimation { target: sideStageImage; property: "x"; to: sideStageSnapAnimation.targetX; duration: UbuntuAnimation.SlowDuration }
389 ScriptAction {
360 ScriptAction {
390 script: {
361 script: {
@@ -392,15 +363,12 @@ Item {
392 if (priv.mainStageAppId) {
363 if (priv.mainStageAppId) {
393 ApplicationManager.focusApplication(priv.mainStageAppId)
364 ApplicationManager.focusApplication(priv.mainStageAppId)
394 } else {
365 } else {
395− print("unfocusing current app")
396 priv.overlayOverride = true;
366 priv.overlayOverride = true;
397 ApplicationManager.unfocusCurrentApplication();
367 ApplicationManager.unfocusCurrentApplication();
398 }
368 }
399 sideStageImage.shown = false;
369 sideStageImage.shown = false;
400 }
370 }
401− print("snapped sidestage to app", sideStageSnapAnimation.snapToId)
402 if (sideStageSnapAnimation.snapToId) {
371 if (sideStageSnapAnimation.snapToId) {
403− print("focusing id", sideStageSnapAnimation.snapToId)
404 ApplicationManager.focusApplication(sideStageSnapAnimation.snapToId)
372 ApplicationManager.focusApplication(sideStageSnapAnimation.snapToId)
405 sideStageSnapAnimation.snapToId = "";
373 sideStageSnapAnimation.snapToId = "";
406 sideStageImage.shown = true;
374 sideStageImage.shown = true;
@@ -408,7 +376,6 @@ Item {
408 }
376 }
409 sideStageImage.visible = false;
377 sideStageImage.visible = false;
410 mainStageImage.visible = false;
378 mainStageImage.visible = false;
411− print("snapped sidestage", root.overlayMode, root.painting)
412 }
379 }
413 }
380 }
414 }
381 }