@@ -19,10 +19,10 @@ import AccountsService 0.1
1919import GSettings 1.0
2020import Unity.Application 0.1
2121import Ubuntu.Components 0.1
22−import Ubuntu.Components.Popups 0.1
2322import Ubuntu.Gestures 0.1
2423import Ubuntu.Telephony 0.1 as Telephony
2524import Unity.Launcher 0.1
25+import Utils 0.1
2626import LightDM 0.1 as LightDM
2727import Powerd 0.1
2828import SessionBroadcast 0.1
@@ -32,10 +32,11 @@ import "Launcher"
3232import "Panel"
3333import "Components"
3434import "Notifications"
35+import "Stages"
3536import Unity.Notifications 1.0 as NotificationBackend
3637import Unity.Session 0.1
3738
38−FocusScope {
39+Item {
3940 id: shell
4041
4142 // this is only here to select the width / height of the window if not running fullscreen
@@ -48,7 +49,7 @@ FocusScope {
4849 property url background
4950 readonly property real panelHeight: panel.panelHeight
5051
51− property bool dashShown: dash.shown
52+ property bool dashShown: dash.shown && dash.available && underlay.visible
5253
5354 property bool sideStageEnabled: shell.width >= units.gu(100)
5455 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
@@ -56,14 +57,10 @@ FocusScope {
5657 function activateApplication(appId) {
5758 if (ApplicationManager.findApplication(appId)) {
5859 ApplicationManager.requestFocusApplication(appId);
59− stages.show(true);
60− if (stages.locked && ApplicationManager.focusedApplicationId == appId) {
61− applicationsDisplayLoader.item.select(appId);
62− }
6360 } else {
6461 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
6562 ApplicationManager.startApplication(appId, execFlags);
66− stages.show(false);
63+ stages.show();
6764 }
6865 }
6966
@@ -90,82 +87,74 @@ FocusScope {
9087 id: volumeControl
9188 }
9289
93− Keys.onVolumeUpPressed: volumeControl.volumeUp()
94− Keys.onVolumeDownPressed: volumeControl.volumeDown()
90+ WindowKeysFilter {
91+ // Handle but do not filter out volume keys
92+ Keys.onVolumeUpPressed: { volumeControl.volumeUp(); event.accepted = false; }
93+ Keys.onVolumeDownPressed: { volumeControl.volumeDown(); event.accepted = false; }
9594
96− Item {
97− id: underlayClipper
98− anchors.fill: parent
99− anchors.rightMargin: stages.overlayWidth
100− clip: stages.overlayMode && !stages.painting
95+ Keys.onPressed: {
96+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
97+ dialogs.onPowerKeyPressed();
98+ event.accepted = true;
99+ } else {
100+ event.accepted = false;
101+ }
102+ }
101103
102− InputFilterArea {
103− anchors.fill: parent
104− blockInput: parent.clip
104+ Keys.onReleased: {
105+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
106+ dialogs.onPowerKeyReleased();
107+ event.accepted = true;
108+ } else {
109+ event.accepted = false;
110+ }
105111 }
112+ }
106113
107− Item {
108− id: underlay
109− objectName: "underlay"
110− anchors.fill: parent
111− anchors.rightMargin: -parent.anchors.rightMargin
114+ Item {
115+ id: underlay
116+ objectName: "underlay"
117+ anchors.fill: parent
112118
113− // Whether the underlay is fully covered by opaque UI elements.
114− property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicators.width
119+ // Whether the underlay is fully covered by opaque UI elements.
120+ property bool fullyCovered: (panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
121+ || stages.fullyShown || greeterWrapper.fullyShown
122+ visible: !fullyCovered
115123
116− // Whether the user should see the topmost application surface (if there's one at all).
117− readonly property bool applicationSurfaceShouldBeSeen: stages.shown && !stages.painting && !stages.overlayMode
124+ Image {
125+ anchors.fill: dash
126+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
127+ fillMode: Image.PreserveAspectCrop
128+ horizontalAlignment: Image.AlignRight
129+ verticalAlignment: Image.AlignTop
130+ }
118131
119− // NB! Application surfaces are stacked behind the shell one. So they can only be seen by the user
120− // through the translucent parts of the shell surface.
121− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
132+ Dash {
133+ id: dash
134+ objectName: "dash"
122135
123− Rectangle {
124− anchors.fill: parent
125− color: "black"
126− opacity: dash.disappearingAnimationProgress
127− }
136+ available: !LightDM.Greeter.active
137+ hides: [stages, launcher, panel.indicators]
138+ shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0 &&
139+ !(panel.indicators.fullyOpened && !sideStageEnabled)
140+ enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
128141
129− Image {
130− anchors.fill: dash
131− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
132− fillMode: Image.PreserveAspectCrop
133− horizontalAlignment: Image.AlignRight
134− verticalAlignment: Image.AlignTop
142+ anchors {
143+ fill: parent
144+ topMargin: panel.panelHeight
135145 }
136146
137− Dash {
138− id: dash
139− objectName: "dash"
140−
141− available: !LightDM.Greeter.active
142− hides: [stages, launcher, panel.indicators]
143− shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0
144− enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
147+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
148+ opacity: 1.0 - disappearingAnimationProgress
149+ property real disappearingAnimationProgress: stages.showProgress
145150
146− anchors {
147− fill: parent
148− topMargin: panel.panelHeight
149− }
150−
151− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
152− opacity: 1.0 - disappearingAnimationProgress
153− property real disappearingAnimationProgress: {
154− if (stages.overlayMode) {
155− return 0;
156− } else {
157− return stages.showProgress
158− }
159− }
160−
161− // FIXME: only necessary because stages.showProgress is not animated
162− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
163− }
151+ // FIXME: only necessary because stages.showProgress is not animated
152+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
164153 }
165154 }
166155
167156 EdgeDragArea {
168− id: stagesDragHandle
157+ id: stagesDragArea
169158 direction: Direction.Leftwards
170159
171160 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
@@ -175,20 +164,20 @@ FocusScope {
175164
176165 onTouchXChanged: {
177166 if (status == DirectionalDragArea.Recognized) {
178− if (ApplicationManager.count == 0) {
179− progress = Math.max(stages.width - stagesDragHandle.width + touchX, stages.width * .3)
167+ if (ApplicationManager.empty) {
168+ progress = Math.max(stages.width - stagesDragArea.width + touchX, stages.width * .3);
180169 } else {
181− progress = stages.width - stagesDragHandle.width + touchX
170+ progress = stages.width - stagesDragArea.width + touchX;
182171 }
183172 }
184173 }
185174
186175 onDraggingChanged: {
187176 if (!dragging) {
188− if (ApplicationManager.count > 0 && progress < stages.width - units.gu(10)) {
189− stages.show(true)
177+ if (!ApplicationManager.empty && progress < stages.width - units.gu(10)) {
178+ stages.show();
190179 }
191− stagesDragHandle.progress = stages.width;
180+ stagesDragArea.progress = Qt.binding(function () { return stages.width; });
192181 }
193182 }
194183 }
@@ -199,253 +188,93 @@ FocusScope {
199188 width: parent.width
200189 height: parent.height
201190
191+ visible: !fullyHidden && !ApplicationManager.empty
192+
202193 x: {
203194 if (shown) {
204− if (overlayMode || locked || greeter.fakeActiveForApp !== "") {
195+ if (locked || greeter.fakeActiveForApp !== "") {
205196 return 0;
206197 }
207− return launcher.progress
198+ return launcher.progress;
208199 } else {
209− return stagesDragHandle.progress
200+ return stagesDragArea.progress
210201 }
211202 }
212−
213203 Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
214204
215205 property bool shown: false
206+ onShownChanged: {
207+ if (shown) {
208+ if (ApplicationManager.count > 0) {
209+ ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
210+ }
211+ } else {
212+ if (ApplicationManager.focusedApplicationId) {
213+ ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
214+ ApplicationManager.unfocusCurrentApplication();
215+ }
216+ }
217+ }
216218
217− property real showProgress: overlayMode ? 0 : MathUtils.clamp(1 - x / shell.width, 0, 1)
219+ // Avoid a silent "divide by zero -> NaN" situation during init as shell.width will be
220+ // zero. That breaks the property binding and the function won't be reevaluated once
221+ // shell.width is set, with the NaN result staying there for good.
222+ property real showProgress: shell.width ? MathUtils.clamp(1 - x / shell.width, 0, 1) : 0
218223
219224 property bool fullyShown: x == 0
220225 property bool fullyHidden: x == width
221226
222− property bool painting: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.painting : false
223− property bool fullscreen: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.fullscreen : false
224− property bool overlayMode: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayMode : false
225− property int overlayWidth: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayWidth : false
226227 property bool locked: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.locked : false
227228
228− function show(focusApp) {
229+ // It might technically not be fullyShown but visually it just looks so.
230+ property bool roughlyFullyShown: x >= 0 && x <= units.gu(1)
231+
232+ function show() {
229233 shown = true;
230− panel.indicators.hide();
231− edgeDemo.stopDemo();
232− greeter.hide();
233− if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
234− ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
235− }
236234 }
237235
238236 function hide() {
239237 shown = false;
240− if (ApplicationManager.focusedApplicationId) {
241− ApplicationManager.unfocusCurrentApplication();
242− }
243238 }
244239
245240 Connections {
246241 target: ApplicationManager
247−
248242 onFocusRequested: {
249243 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== appId) {
250244 lockscreen.show();
251245 }
252246 greeter.hide();
253− stages.show(true);
247+ stages.show();
254248 }
255249
256250 onFocusedApplicationIdChanged: {
257251 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== ApplicationManager.focusedApplicationId) {
258252 lockscreen.show();
259253 }
260− if (ApplicationManager.focusedApplicationId.length > 0) {
261− stages.show(false);
262− } else {
263− if (!stages.overlayMode) {
264− stages.hide();
265− }
266− }
254+ panel.indicators.hide();
267255 }
268256
269257 onApplicationAdded: {
270− stages.show(false);
271− }
272−
273− onApplicationRemoved: {
274− if (ApplicationManager.focusedApplicationId.length == 0) {
275− stages.hide();
276− }
277− }
278− }
279−
280− property bool dialogShown: false
281−
282− Component {
283− id: logoutDialog
284− Dialog {
285− id: dialogueLogout
286− title: "Logout"
287− text: "Are you sure that you want to logout?"
288− Button {
289− text: "Cancel"
290− onClicked: {
291− PopupUtils.close(dialogueLogout);
292− stages.dialogShown = false;
293− }
294− }
295− Button {
296− text: "Yes"
297− onClicked: {
298− DBusUnitySessionService.Logout();
299− PopupUtils.close(dialogueLogout);
300− stages.dialogShown = false;
301− }
302− }
303− }
304− }
305−
306− Component {
307− id: shutdownDialog
308− Dialog {
309− id: dialogueShutdown
310− title: "Shutdown"
311− text: "Are you sure that you want to shutdown?"
312− Button {
313− text: "Cancel"
314− onClicked: {
315− PopupUtils.close(dialogueShutdown);
316− stages.dialogShown = false;
317− }
318− }
319− Button {
320− text: "Yes"
321− onClicked: {
322− dBusUnitySessionServiceConnection.closeAllApps();
323− DBusUnitySessionService.Shutdown();
324− PopupUtils.close(dialogueShutdown);
325− stages.dialogShown = false;
326− }
327− }
328− }
329− }
330−
331− Component {
332− id: rebootDialog
333− Dialog {
334− id: dialogueReboot
335− title: "Reboot"
336− text: "Are you sure that you want to reboot?"
337− Button {
338− text: "Cancel"
339− onClicked: {
340− PopupUtils.close(dialogueReboot)
341− stages.dialogShown = false;
342− }
343− }
344− Button {
345− text: "Yes"
346− onClicked: {
347− dBusUnitySessionServiceConnection.closeAllApps();
348− DBusUnitySessionService.Reboot();
349− PopupUtils.close(dialogueReboot);
350− stages.dialogShown = false;
351− }
352− }
353− }
354− }
355−
356− Component {
357− id: powerDialog
358− Dialog {
359− id: dialoguePower
360− title: "Power"
361− text: i18n.tr("Are you sure you would like to turn power off?")
362− Button {
363− text: i18n.tr("Power off")
364− onClicked: {
365− dBusUnitySessionServiceConnection.closeAllApps();
366− PopupUtils.close(dialoguePower);
367− stages.dialogShown = false;
368− shutdownFadeOutRectangle.enabled = true;
369− shutdownFadeOutRectangle.visible = true;
370− shutdownFadeOut.start();
371− }
372− }
373− Button {
374− text: i18n.tr("Restart")
375− onClicked: {
376− dBusUnitySessionServiceConnection.closeAllApps();
377− DBusUnitySessionService.Reboot();
378− PopupUtils.close(dialoguePower);
379− stages.dialogShown = false;
380− }
381− }
382− Button {
383− text: i18n.tr("Cancel")
384− onClicked: {
385− PopupUtils.close(dialoguePower);
386− stages.dialogShown = false;
387− }
388− }
389− }
390− }
391−
392− function showPowerDialog() {
393− if (!stages.dialogShown) {
394− stages.dialogShown = true;
395− PopupUtils.open(powerDialog);
396− }
397− }
398−
399− Connections {
400− id: dBusUnitySessionServiceConnection
401− objectName: "dBusUnitySessionServiceConnection"
402− target: DBusUnitySessionService
403−
404− function closeAllApps() {
405− while (true) {
406− var app = ApplicationManager.get(0);
407− if (app === null) {
408− break;
409− }
410− ApplicationManager.stopApplication(app.appId);
258+ if (greeter.shown) {
259+ greeter.hide();
411260 }
412− }
413−
414− onLogoutRequested: {
415− // Display a dialog to ask the user to confirm.
416− if (!stages.dialogShown) {
417− stages.dialogShown = true;
418− PopupUtils.open(logoutDialog);
261+ if (!stages.shown) {
262+ stages.show();
419263 }
420264 }
421265
422− onShutdownRequested: {
423− // Display a dialog to ask the user to confirm.
424− if (!stages.dialogShown) {
425− stages.dialogShown = true;
426− PopupUtils.open(shutdownDialog);
427− }
428− }
429−
430− onRebootRequested: {
431− // Display a dialog to ask the user to confirm.
432− if (!stages.dialogShown) {
433− stages.dialogShown = true;
434− PopupUtils.open(rebootDialog);
266+ onEmptyChanged: {
267+ if (ApplicationManager.empty) {
268+ stages.hide();
435269 }
436270 }
437−
438− onLogoutReady: {
439− closeAllApps();
440− Qt.quit();
441− }
442271 }
443272
444273 Loader {
445274 id: applicationsDisplayLoader
446275 anchors.fill: parent
447276
448− source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
277+ source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
449278
450279 Binding {
451280 target: applicationsDisplayLoader.item
@@ -454,18 +283,20 @@ FocusScope {
454283 }
455284 Binding {
456285 target: applicationsDisplayLoader.item
457− property: "moving"
458− value: !stages.fullyShown
286+ property: "dragAreaWidth"
287+ value: shell.edgeSize
459288 }
460289 Binding {
461290 target: applicationsDisplayLoader.item
462− property: "shown"
463− value: stages.shown
291+ property: "maximizedAppTopMargin"
292+ // Not just using panel.panelHeight as that changes depending on the focused app.
293+ value: panel.indicators.panelHeight
464294 }
465295 Binding {
466296 target: applicationsDisplayLoader.item
467− property: "dragAreaWidth"
468− value: shell.edgeSize
297+ property: "interactive"
298+ value: stages.roughlyFullyShown && !greeter.shown && !lockscreen.shown
299+ && panel.indicators.fullyClosed
469300 }
470301 Binding {
471302 target: applicationsDisplayLoader.item
@@ -475,6 +306,33 @@ FocusScope {
475306 }
476307 }
477308
309+ InputMethod {
310+ id: inputMethod
311+ objectName: "inputMethod"
312+ anchors { fill: parent; topMargin: panel.panelHeight }
313+ z: notifications.useModal || panel.indicators.shown ? overlay.z + 1 : overlay.z - 1
314+ }
315+
316+ Connections {
317+ target: SurfaceManager
318+ onSurfaceCreated: {
319+ if (surface.type == MirSurfaceItem.InputMethod) {
320+ inputMethod.surface = surface;
321+ }
322+ }
323+
324+ onSurfaceDestroyed: {
325+ if (inputMethod.surface == surface) {
326+ inputMethod.surface = null;
327+ surface.parent = null;
328+ }
329+ if (!surface.parent) {
330+ // there's no one displaying it. delete it right away
331+ surface.release();
332+ }
333+ }
334+ }
335+
478336 Lockscreen {
479337 id: lockscreen
480338 objectName: "lockscreen"
@@ -487,7 +345,7 @@ FocusScope {
487345 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
488346 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
489347 y: panel.panelHeight
490− x: required ? 0 : - width
348+ visible: required
491349 width: parent.width
492350 height: parent.height - panel.panelHeight
493351 background: shell.background
@@ -567,6 +425,7 @@ FocusScope {
567425 StandardAnimation {}
568426 }
569427
428+ property bool fullyShown: showProgress === 1.0
570429 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
571430 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
572431
@@ -633,12 +492,6 @@ FocusScope {
633492 }
634493 }
635494
636− InputFilterArea {
637− anchors.fill: parent
638− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
639− || panel.indicators.shown
640− }
641−
642495 function showGreeterIfScreenIsOff() {
643496 if (Powerd.status === Powerd.Off && !callManager.hasCalls && !edgeDemo.running) {
644497 greeter.showNow()
@@ -689,7 +542,7 @@ FocusScope {
689542 return;
690543 }
691544
692− if (stages.shown && !stages.overlayMode && !stages.locked) {
545+ if (!stages.locked) {
693546 stages.hide();
694547 launcher.fadeOut();
695548 } else {
@@ -704,6 +557,7 @@ FocusScope {
704557
705558 Item {
706559 id: overlay
560+ z: 10
707561
708562 anchors.fill: parent
709563
@@ -718,29 +572,13 @@ FocusScope {
718572 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
719573 panelHeight: units.gu(3)
720574 }
721− property string focusedAppId: ApplicationManager.focusedApplicationId
722− property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
723− fullscreenMode: (focusedApplication && stages.fullscreen && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
724575
725− InputFilterArea {
726− anchors {
727− top: parent.top
728− left: parent.left
729− right: parent.right
730− }
731− height: (panel.fullscreenMode) ? shell.edgeSize : panel.panelHeight
732− blockInput: true
733− }
734− }
576+ property bool topmostApplicationIsFullscreen:
577+ ApplicationManager.focusedApplicationId &&
578+ ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
735579
736− InputFilterArea {
737− blockInput: launcher.shown
738− anchors {
739− top: parent.top
740− bottom: parent.bottom
741− left: parent.left
742− }
743− width: launcher.width
580+ fullscreenMode: (stages.roughlyFullyShown && topmostApplicationIsFullscreen
581+ && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
744582 }
745583
746584 Launcher {
@@ -783,11 +621,6 @@ FocusScope {
783621 MouseArea {
784622 anchors.fill: parent
785623 }
786−
787− InputFilterArea {
788− anchors.fill: parent
789− blockInput: modalNotificationBackground.visible
790− }
791624 }
792625
793626 Notifications {
@@ -813,36 +646,7 @@ FocusScope {
813646 PropertyChanges { target: notifications; width: units.gu(38) }
814647 }
815648 ]
816−
817− InputFilterArea {
818− anchors { left: parent.left; right: parent.right }
819− height: parent.contentHeight
820− blockInput: height > 0
821− }
822− }
823− }
824−
825− focus: true
826− onFocusChanged: if (!focus) forceActiveFocus();
827−
828− InputFilterArea {
829− anchors {
830− top: parent.top
831− bottom: parent.bottom
832− left: parent.left
833− }
834− width: shell.edgeSize
835− blockInput: true
836− }
837−
838− InputFilterArea {
839− anchors {
840− top: parent.top
841− bottom: parent.bottom
842− right: parent.right
843649 }
844− width: shell.edgeSize
845− blockInput: true
846650 }
847651
848652 Binding {
@@ -851,24 +655,22 @@ FocusScope {
851655 value: "unity8"
852656 }
853657
854− OSKController {
855− anchors.topMargin: panel.panelHeight
856− anchors.fill: parent // as needs to know the geometry of the shell
857− }
858−
859− //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
860− MouseArea {
861− anchors.bottom: parent.bottom
862− anchors.left: parent.left
863− anchors.right: parent.right
864− height: ApplicationManager.keyboardVisible ? ApplicationManager.keyboardHeight : 0
865−
866− enabled: ApplicationManager.keyboardVisible
658+ Dialogs {
659+ id: dialogs
660+ anchors.fill: parent
661+ z: overlay.z + 10
662+ onPowerOffClicked: {
663+ shutdownFadeOutRectangle.enabled = true;
664+ shutdownFadeOutRectangle.visible = true;
665+ shutdownFadeOut.start();
666+ }
867667 }
868668
869669 Label {
670+ id: alphaDisclaimerLabel
870671 anchors.centerIn: parent
871672 visible: ApplicationManager.fake ? ApplicationManager.fake : false
673+ z: dialogs.z + 10
872674 text: "EARLY ALPHA\nNOT READY FOR USE"
873675 color: "lightgrey"
874676 opacity: 0.2
@@ -882,6 +684,7 @@ FocusScope {
882684
883685 EdgeDemo {
884686 id: edgeDemo
687+ z: alphaDisclaimerLabel.z + 10
885688 greeter: greeter
886689 launcher: launcher
887690 dash: dash
@@ -894,35 +697,9 @@ FocusScope {
894697 onShowHome: showHome()
895698 }
896699
897− Keys.onPressed: {
898− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
899− if (!powerKeyTimer.running) {
900− powerKeyTimer.start();
901− }
902− event.accepted = true;
903− }
904− }
905−
906− Keys.onReleased: {
907− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
908− powerKeyTimer.stop();
909− event.accepted = true;
910− }
911− }
912−
913− Timer {
914− id: powerKeyTimer
915− interval: 2000
916− repeat: false
917− triggeredOnStart: false
918−
919− onTriggered: {
920− stages.showPowerDialog();
921− }
922− }
923−
924700 Rectangle {
925701 id: shutdownFadeOutRectangle
702+ z: edgeDemo.z + 10
926703 enabled: false
927704 visible: false
928705 color: "black"
@@ -939,4 +716,5 @@ FocusScope {
939716 }
940717 }
941718 }
719+
942720}