@@ -19,9 +19,9 @@ 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 Unity.Launcher 0.1
24+import Utils 0.1
2525import LightDM 0.1 as LightDM
2626import Powerd 0.1
2727import SessionBroadcast 0.1
@@ -31,10 +31,11 @@ import "Launcher"
3131import "Panel"
3232import "Components"
3333import "Notifications"
34+import "Stages"
3435import Unity.Notifications 1.0 as NotificationBackend
3536import Unity.Session 0.1
3637
37−FocusScope {
38+Item {
3839 id: shell
3940
4041 // this is only here to select the width / height of the window if not running fullscreen
@@ -47,7 +48,7 @@ FocusScope {
4748 property url background
4849 readonly property real panelHeight: panel.panelHeight
4950
50− property bool dashShown: dash.shown
51+ property bool dashShown: dash.shown && dash.available && underlay.visible
5152 property bool locked: LightDM.Greeter.active && !LightDM.Greeter.promptless
5253
5354 property bool sideStageEnabled: shell.width >= units.gu(100)
@@ -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"
147+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
148+ opacity: 1.0 - disappearingAnimationProgress
149+ property real disappearingAnimationProgress: stages.showProgress
140150
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
145−
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
@@ -574,6 +432,7 @@ FocusScope {
574432 StandardAnimation {}
575433 }
576434
435+ property bool fullyShown: showProgress === 1.0
577436 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
578437 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
579438
@@ -640,12 +499,6 @@ FocusScope {
640499 }
641500 }
642501
643− InputFilterArea {
644− anchors.fill: parent
645− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
646− || panel.indicators.shown
647− }
648−
649502 Connections {
650503 id: powerConnection
651504 target: Powerd
@@ -688,7 +541,7 @@ FocusScope {
688541 return;
689542 }
690543
691− if (stages.shown && !stages.overlayMode && !stages.locked) {
544+ if (!stages.locked) {
692545 stages.hide();
693546 launcher.fadeOut();
694547 } else {
@@ -703,6 +556,7 @@ FocusScope {
703556
704557 Item {
705558 id: overlay
559+ z: 10
706560
707561 anchors.fill: parent
708562
@@ -717,29 +571,13 @@ FocusScope {
717571 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
718572 panelHeight: units.gu(3)
719573 }
720− property string focusedAppId: ApplicationManager.focusedApplicationId
721− property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
722− fullscreenMode: (focusedApplication && stages.fullscreen && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
723574
724− InputFilterArea {
725− anchors {
726− top: parent.top
727− left: parent.left
728− right: parent.right
729− }
730− height: (panel.fullscreenMode) ? shell.edgeSize : panel.panelHeight
731− blockInput: true
732− }
733− }
575+ property bool topmostApplicationIsFullscreen:
576+ ApplicationManager.focusedApplicationId &&
577+ ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
734578
735− InputFilterArea {
736− blockInput: launcher.shown
737− anchors {
738− top: parent.top
739− bottom: parent.bottom
740− left: parent.left
741− }
742− width: launcher.width
579+ fullscreenMode: (stages.roughlyFullyShown && topmostApplicationIsFullscreen
580+ && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
743581 }
744582
745583 Launcher {
@@ -782,11 +620,6 @@ FocusScope {
782620 MouseArea {
783621 anchors.fill: parent
784622 }
785−
786− InputFilterArea {
787− anchors.fill: parent
788− blockInput: modalNotificationBackground.visible
789− }
790623 }
791624
792625 Notifications {
@@ -812,36 +645,7 @@ FocusScope {
812645 PropertyChanges { target: notifications; width: units.gu(38) }
813646 }
814647 ]
815−
816− InputFilterArea {
817− anchors { left: parent.left; right: parent.right }
818− height: parent.contentHeight
819− blockInput: height > 0
820− }
821− }
822− }
823−
824− focus: true
825− onFocusChanged: if (!focus) forceActiveFocus();
826−
827− InputFilterArea {
828− anchors {
829− top: parent.top
830− bottom: parent.bottom
831− left: parent.left
832− }
833− width: shell.edgeSize
834− blockInput: true
835− }
836−
837− InputFilterArea {
838− anchors {
839− top: parent.top
840− bottom: parent.bottom
841− right: parent.right
842648 }
843− width: shell.edgeSize
844− blockInput: true
845649 }
846650
847651 Binding {
@@ -850,24 +654,22 @@ FocusScope {
850654 value: "unity8"
851655 }
852656
853− OSKController {
854− anchors.topMargin: panel.panelHeight
855− anchors.fill: parent // as needs to know the geometry of the shell
856− }
857−
858− //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
859− MouseArea {
860− anchors.bottom: parent.bottom
861− anchors.left: parent.left
862− anchors.right: parent.right
863− height: ApplicationManager.keyboardVisible ? ApplicationManager.keyboardHeight : 0
864−
865− enabled: ApplicationManager.keyboardVisible
657+ Dialogs {
658+ id: dialogs
659+ anchors.fill: parent
660+ z: overlay.z + 10
661+ onPowerOffClicked: {
662+ shutdownFadeOutRectangle.enabled = true;
663+ shutdownFadeOutRectangle.visible = true;
664+ shutdownFadeOut.start();
665+ }
866666 }
867667
868668 Label {
669+ id: alphaDisclaimerLabel
869670 anchors.centerIn: parent
870671 visible: ApplicationManager.fake ? ApplicationManager.fake : false
672+ z: dialogs.z + 10
871673 text: "EARLY ALPHA\nNOT READY FOR USE"
872674 color: "lightgrey"
873675 opacity: 0.2
@@ -881,6 +683,7 @@ FocusScope {
881683
882684 EdgeDemo {
883685 id: edgeDemo
686+ z: alphaDisclaimerLabel.z + 10
884687 greeter: greeter
885688 launcher: launcher
886689 dash: dash
@@ -893,35 +696,9 @@ FocusScope {
893696 onShowHome: showHome()
894697 }
895698
896− Keys.onPressed: {
897− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
898− if (!powerKeyTimer.running) {
899− powerKeyTimer.start();
900− }
901− event.accepted = true;
902− }
903− }
904−
905− Keys.onReleased: {
906− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
907− powerKeyTimer.stop();
908− event.accepted = true;
909− }
910− }
911−
912− Timer {
913− id: powerKeyTimer
914− interval: 2000
915− repeat: false
916− triggeredOnStart: false
917−
918− onTriggered: {
919− stages.showPowerDialog();
920− }
921− }
922−
923699 Rectangle {
924700 id: shutdownFadeOutRectangle
701+ z: edgeDemo.z + 10
925702 enabled: false
926703 visible: false
927704 color: "black"
@@ -938,4 +715,5 @@ FocusScope {
938715 }
939716 }
940717 }
718+
941719}