@@ -19,22 +19,23 @@ 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
28−import "Dash"
2928import "Greeter"
3029import "Launcher"
3130import "Panel"
3231import "Components"
3332import "Notifications"
33+import "Stages"
3434import Unity.Notifications 1.0 as NotificationBackend
3535import Unity.Session 0.1
36+import Unity.DashCommunicator 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,22 +48,15 @@ FocusScope {
4748 property url background
4849 readonly property real panelHeight: panel.panelHeight
4950
50− property bool dashShown: dash.shown
51−
5251 property bool sideStageEnabled: shell.width >= units.gu(100)
5352 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
5453
5554 function activateApplication(appId) {
5655 if (ApplicationManager.findApplication(appId)) {
5756 ApplicationManager.requestFocusApplication(appId);
58− stages.show(true);
59− if (stages.locked && ApplicationManager.focusedApplicationId == appId) {
60− applicationsDisplayLoader.item.select(appId);
61− }
6257 } else {
6358 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
6459 ApplicationManager.startApplication(appId, execFlags);
65− stages.show(false);
6660 }
6761 }
6862
@@ -89,105 +83,31 @@ FocusScope {
8983 id: volumeControl
9084 }
9185
92− Keys.onVolumeUpPressed: volumeControl.volumeUp()
93− Keys.onVolumeDownPressed: volumeControl.volumeDown()
94−
95− Item {
96− id: underlayClipper
97− anchors.fill: parent
98− anchors.rightMargin: stages.overlayWidth
99− clip: stages.overlayMode && !stages.painting
100−
101− InputFilterArea {
102− anchors.fill: parent
103− blockInput: parent.clip
104− }
105−
106− Item {
107− id: underlay
108− objectName: "underlay"
109− anchors.fill: parent
110− anchors.rightMargin: -parent.anchors.rightMargin
111−
112− // Whether the underlay is fully covered by opaque UI elements.
113− property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicators.width
114−
115− // Whether the user should see the topmost application surface (if there's one at all).
116− readonly property bool applicationSurfaceShouldBeSeen: stages.shown && !stages.painting && !stages.overlayMode
117−
118− // NB! Application surfaces are stacked behind the shell one. So they can only be seen by the user
119− // through the translucent parts of the shell surface.
120− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
121−
122− Rectangle {
123− anchors.fill: parent
124− color: "black"
125− opacity: dash.disappearingAnimationProgress
126− }
127−
128− Image {
129− anchors.fill: dash
130− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
131− fillMode: Image.PreserveAspectCrop
132− horizontalAlignment: Image.AlignRight
133− verticalAlignment: Image.AlignTop
134− }
135−
136− Dash {
137− id: dash
138− objectName: "dash"
139−
140− available: !greeter.shown && !lockscreen.shown
141− hides: [stages, launcher, panel.indicators]
142− shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0
143− enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
144−
145− anchors {
146− fill: parent
147− topMargin: panel.panelHeight
148− }
149−
150− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
151− opacity: 1.0 - disappearingAnimationProgress
152− property real disappearingAnimationProgress: {
153− if (stages.overlayMode) {
154− return 0;
155− } else {
156− return stages.showProgress
157− }
158− }
159−
160− // FIXME: only necessary because stages.showProgress is not animated
161− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
162− }
163− }
86+ DashCommunicator {
87+ id: dash
88+ objectName: "dashCommunicator"
16489 }
16590
166− EdgeDragArea {
167− id: stagesDragHandle
168− direction: Direction.Leftwards
169−
170− anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
171− width: shell.edgeSize
91+ WindowKeysFilter {
92+ // Handle but do not filter out volume keys
93+ Keys.onVolumeUpPressed: { volumeControl.volumeUp(); event.accepted = false; }
94+ Keys.onVolumeDownPressed: { volumeControl.volumeDown(); event.accepted = false; }
17295
173− property real progress: stages.width
174−
175− onTouchXChanged: {
176− if (status == DirectionalDragArea.Recognized) {
177− if (ApplicationManager.count == 0) {
178− progress = Math.max(stages.width - stagesDragHandle.width + touchX, stages.width * .3)
179− } else {
180− progress = stages.width - stagesDragHandle.width + touchX
181− }
96+ Keys.onPressed: {
97+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
98+ dialogs.onPowerKeyPressed();
99+ event.accepted = true;
100+ } else {
101+ event.accepted = false;
182102 }
183103 }
184104
185− onDraggingChanged: {
186− if (!dragging) {
187− if (ApplicationManager.count > 0 && progress < stages.width - units.gu(10)) {
188− stages.show(true)
189− }
190− stagesDragHandle.progress = stages.width;
105+ Keys.onReleased: {
106+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
107+ dialogs.onPowerKeyReleased();
108+ event.accepted = true;
109+ } else {
110+ event.accepted = false;
191111 }
192112 }
193113 }
@@ -197,262 +117,94 @@ FocusScope {
197117 objectName: "stages"
198118 width: parent.width
199119 height: parent.height
200−
201− x: {
202− if (shown) {
203− if (overlayMode || locked) {
204− return 0;
205− }
206− return launcher.progress
207− } else {
208− return stagesDragHandle.progress
209− }
210− }
211−
212− Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
213−
214− property bool shown: false
215−
216− property real showProgress: overlayMode ? 0 : MathUtils.clamp(1 - x / shell.width, 0, 1)
217−
218− property bool fullyShown: x == 0
219− property bool fullyHidden: x == width
220−
221− property bool painting: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.painting : false
222− property bool fullscreen: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.fullscreen : false
223− property bool overlayMode: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayMode : false
224− property int overlayWidth: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayWidth : false
225− property bool locked: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.locked : false
226−
227− function show(focusApp) {
228− shown = true;
229− panel.indicators.hide();
230− edgeDemo.stopDemo();
231− greeter.hide();
232− if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
233− ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
234− }
235− }
236−
237− function hide() {
238− shown = false;
239− if (ApplicationManager.focusedApplicationId) {
240− ApplicationManager.unfocusCurrentApplication();
241− }
242− }
120+ visible: !ApplicationManager.empty
243121
244122 Connections {
245123 target: ApplicationManager
246−
247124 onFocusRequested: {
248− stages.show(true);
125+ if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== appId) {
126+ lockscreen.show();
127+ }
128+ greeter.hide();
249129 }
250130
251131 onFocusedApplicationIdChanged: {
252− if (ApplicationManager.focusedApplicationId.length > 0) {
253− stages.show(false);
254− } else {
255− if (!stages.overlayMode) {
256− stages.hide();
257− }
132+ if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== ApplicationManager.focusedApplicationId) {
133+ lockscreen.show();
258134 }
135+ panel.indicators.hide();
259136 }
260137
261138 onApplicationAdded: {
262− stages.show(false);
263− }
264−
265− onApplicationRemoved: {
266− if (ApplicationManager.focusedApplicationId.length == 0) {
267− stages.hide();
139+ if (greeter.shown && appId != "unity8-dash") {
140+ greeter.hide();
268141 }
269142 }
270143 }
271144
272− property bool dialogShown: false
273−
274− Component {
275− id: logoutDialog
276− Dialog {
277− id: dialogueLogout
278− title: "Logout"
279− text: "Are you sure that you want to logout?"
280− Button {
281− text: "Cancel"
282− onClicked: {
283− PopupUtils.close(dialogueLogout);
284− stages.dialogShown = false;
285− }
286− }
287− Button {
288− text: "Yes"
289− onClicked: {
290− DBusUnitySessionService.Logout();
291− PopupUtils.close(dialogueLogout);
292− stages.dialogShown = false;
293− }
294− }
295− }
296− }
145+ Loader {
146+ id: applicationsDisplayLoader
147+ anchors.fill: parent
297148
298− Component {
299− id: shutdownDialog
300− Dialog {
301− id: dialogueShutdown
302− title: "Shutdown"
303− text: "Are you sure that you want to shutdown?"
304− Button {
305− text: "Cancel"
306− onClicked: {
307− PopupUtils.close(dialogueShutdown);
308− stages.dialogShown = false;
309− }
310− }
311− Button {
312− text: "Yes"
313− onClicked: {
314− dBusUnitySessionServiceConnection.closeAllApps();
315− DBusUnitySessionService.Shutdown();
316− PopupUtils.close(dialogueShutdown);
317− stages.dialogShown = false;
318− }
319− }
320− }
321− }
149+ source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
322150
323− Component {
324− id: rebootDialog
325− Dialog {
326− id: dialogueReboot
327− title: "Reboot"
328− text: "Are you sure that you want to reboot?"
329− Button {
330− text: "Cancel"
331− onClicked: {
332− PopupUtils.close(dialogueReboot)
333− stages.dialogShown = false;
334− }
335− }
336− Button {
337− text: "Yes"
338− onClicked: {
339− dBusUnitySessionServiceConnection.closeAllApps();
340− DBusUnitySessionService.Reboot();
341− PopupUtils.close(dialogueReboot);
342− stages.dialogShown = false;
343− }
344− }
151+ Binding {
152+ target: applicationsDisplayLoader.item
153+ property: "objectName"
154+ value: "stage"
345155 }
346− }
347−
348− Component {
349− id: powerDialog
350− Dialog {
351− id: dialoguePower
352− title: "Power"
353− text: i18n.tr("Are you sure you would like to turn power off?")
354− Button {
355− text: i18n.tr("Power off")
356− onClicked: {
357− dBusUnitySessionServiceConnection.closeAllApps();
358− PopupUtils.close(dialoguePower);
359− stages.dialogShown = false;
360− shutdownFadeOutRectangle.enabled = true;
361− shutdownFadeOutRectangle.visible = true;
362− shutdownFadeOut.start();
363− }
364− }
365− Button {
366− text: i18n.tr("Restart")
367− onClicked: {
368− dBusUnitySessionServiceConnection.closeAllApps();
369− DBusUnitySessionService.Reboot();
370− PopupUtils.close(dialoguePower);
371− stages.dialogShown = false;
372− }
373− }
374− Button {
375− text: i18n.tr("Cancel")
376− onClicked: {
377− PopupUtils.close(dialoguePower);
378− stages.dialogShown = false;
379− }
380− }
156+ Binding {
157+ target: applicationsDisplayLoader.item
158+ property: "dragAreaWidth"
159+ value: shell.edgeSize
381160 }
382− }
383−
384− function showPowerDialog() {
385− if (!stages.dialogShown) {
386− stages.dialogShown = true;
387− PopupUtils.open(powerDialog);
161+ Binding {
162+ target: applicationsDisplayLoader.item
163+ property: "maximizedAppTopMargin"
164+ // Not just using panel.panelHeight as that changes depending on the focused app.
165+ value: panel.indicators.panelHeight
388166 }
389− }
390−
391− Connections {
392− id: dBusUnitySessionServiceConnection
393− objectName: "dBusUnitySessionServiceConnection"
394− target: DBusUnitySessionService
395−
396− function closeAllApps() {
397− while (true) {
398− var app = ApplicationManager.get(0);
399− if (app === null) {
400− break;
401− }
402− ApplicationManager.stopApplication(app.appId);
403− }
167+ Binding {
168+ target: applicationsDisplayLoader.item
169+ property: "interactive"
170+ value: edgeDemo.stagesEnabled && !greeter.shown && !lockscreen.shown && panel.indicators.fullyClosed && launcher.progress == 0
404171 }
405−
406− onLogoutRequested: {
407− // Display a dialog to ask the user to confirm.
408− if (!stages.dialogShown) {
409− stages.dialogShown = true;
410− PopupUtils.open(logoutDialog);
411− }
172+ Binding {
173+ target: applicationsDisplayLoader.item
174+ property: "spreadEnabled"
175+ value: edgeDemo.stagesEnabled && greeter.fakeActiveForApp === "" // to support emergency dialer hack
412176 }
413−
414− onShutdownRequested: {
415− // Display a dialog to ask the user to confirm.
416− if (!stages.dialogShown) {
417− stages.dialogShown = true;
418− PopupUtils.open(shutdownDialog);
419− }
177+ Binding {
178+ target: applicationsDisplayLoader.item
179+ property: "inverseProgress"
180+ value: launcher.progress
420181 }
182+ }
183+ }
421184
422− onRebootRequested: {
423− // Display a dialog to ask the user to confirm.
424− if (!stages.dialogShown) {
425− stages.dialogShown = true;
426− PopupUtils.open(rebootDialog);
427− }
428− }
185+ InputMethod {
186+ id: inputMethod
187+ objectName: "inputMethod"
188+ anchors { fill: parent; topMargin: panel.panelHeight }
189+ z: notifications.useModal || panel.indicators.shown ? overlay.z + 1 : overlay.z - 1
190+ }
429191
430− onLogoutReady: {
431− closeAllApps();
432− Qt.quit();
192+ Connections {
193+ target: SurfaceManager
194+ onSurfaceCreated: {
195+ if (surface.type == MirSurfaceItem.InputMethod) {
196+ inputMethod.surface = surface;
433197 }
434198 }
435199
436− Loader {
437− id: applicationsDisplayLoader
438− anchors.fill: parent
439−
440− source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
441−
442− Binding {
443− target: applicationsDisplayLoader.item
444− property: "moving"
445− value: !stages.fullyShown
200+ onSurfaceDestroyed: {
201+ if (inputMethod.surface == surface) {
202+ inputMethod.surface = null;
203+ surface.parent = null;
446204 }
447− Binding {
448− target: applicationsDisplayLoader.item
449− property: "shown"
450− value: stages.shown
451− }
452− Binding {
453− target: applicationsDisplayLoader.item
454− property: "dragAreaWidth"
455− value: shell.edgeSize
205+ if (!surface.parent) {
206+ // there's no one displaying it. delete it right away
207+ surface.release();
456208 }
457209 }
458210 }
@@ -469,18 +221,26 @@ FocusScope {
469221 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
470222 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
471223 y: panel.panelHeight
472− x: required ? 0 : - width
224+ visible: required
473225 width: parent.width
474226 height: parent.height - panel.panelHeight
475227 background: shell.background
228+ alphaNumeric: AccountsService.passwordDisplayHint === AccountsService.Keyboard
476229 minPinLength: 4
477230 maxPinLength: 4
478231
479232 onEntered: LightDM.Greeter.respond(passphrase);
480233 onCancel: greeter.show()
234+ onEmergencyCall: {
235+ greeter.fakeActiveForApp = "dialer-app"
236+ shell.activateApplication("dialer-app")
237+ lockscreen.hide()
238+ }
239+
240+ onShownChanged: if (shown) greeter.fakeActiveForApp = ""
481241
482242 Component.onCompleted: {
483− if (LightDM.Users.count == 1) {
243+ if (greeter.narrowMode) {
484244 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
485245 }
486246 }
@@ -492,14 +252,17 @@ FocusScope {
492252 onShowGreeter: greeter.show()
493253
494254 onShowPrompt: {
495− if (LightDM.Users.count == 1) {
496− // TODO: There's no better way for now to determine if its a PIN or a passphrase.
497− if (text == "PIN") {
498− lockscreen.alphaNumeric = false
499− } else {
500− lockscreen.alphaNumeric = true
501− }
502− lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
255+ if (greeter.narrowMode) {
256+ lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text.toLowerCase());
257+ lockscreen.show();
258+ }
259+ }
260+
261+ onPromptlessChanged: {
262+ if (LightDM.Greeter.promptless) {
263+ lockscreen.hide()
264+ } else {
265+ lockscreen.reset();
503266 lockscreen.show();
504267 }
505268 }
@@ -510,8 +273,12 @@ FocusScope {
510273 }
511274 if (LightDM.Greeter.authenticated) {
512275 lockscreen.hide();
276+ greeter.login();
513277 } else {
514278 lockscreen.clear(true);
279+ if (greeter.narrowMode) {
280+ LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
281+ }
515282 }
516283 }
517284 }
@@ -519,7 +286,7 @@ FocusScope {
519286 Binding {
520287 target: LightDM.Greeter
521288 property: "active"
522− value: greeter.shown || lockscreen.shown
289+ value: greeter.shown || lockscreen.shown || greeter.fakeActiveForApp != ""
523290 }
524291
525292 Rectangle {
@@ -541,12 +308,18 @@ FocusScope {
541308 StandardAnimation {}
542309 }
543310
311+ property bool fullyShown: showProgress === 1.0
544312 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
313+ onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
545314
546315 Greeter {
547316 id: greeter
548317 objectName: "greeter"
549318
319+ signal sessionStarted() // helpful for tests
320+
321+ property string fakeActiveForApp: ""
322+
550323 available: true
551324 hides: [launcher, panel.indicators]
552325 shown: true
@@ -558,17 +331,27 @@ FocusScope {
558331
559332 dragHandleWidth: shell.edgeSize
560333
334+ function login() {
335+ enabled = false;
336+ if (LightDM.Greeter.startSessionSync()) {
337+ sessionStarted();
338+ greeter.hide();
339+ lockscreen.hide();
340+ launcher.hide();
341+ }
342+ enabled = true;
343+ }
344+
561345 onShownChanged: {
562346 if (shown) {
563− lockscreen.reset();
564− if (!LightDM.Greeter.promptless) {
565− lockscreen.show();
566− }
567− // If there is only one user, we start authenticating with that one here.
568− // If there are more users, the Greeter will handle that
569− if (LightDM.Users.count == 1) {
347+ if (greeter.narrowMode) {
570348 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
571349 }
350+ if (!LightDM.Greeter.promptless) {
351+ lockscreen.reset();
352+ lockscreen.show();
353+ }
354+ greeter.fakeActiveForApp = "";
572355 greeter.forceActiveFocus();
573356 }
574357 }
@@ -591,12 +374,6 @@ FocusScope {
591374 }
592375 }
593376
594− InputFilterArea {
595− anchors.fill: parent
596− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
597− || panel.indicators.shown
598− }
599−
600377 Connections {
601378 id: powerConnection
602379 target: Powerd
@@ -604,7 +381,7 @@ FocusScope {
604381 onDisplayPowerStateChange: {
605382 // We ignore any display-off signals when the proximity sensor
606383 // is active. This usually indicates something like a phone call.
607− if (status == Powerd.Off && reason != Powerd.Proximity) {
384+ if (status == Powerd.Off && reason != Powerd.Proximity && !edgeDemo.running) {
608385 greeter.showNow();
609386 }
610387
@@ -618,54 +395,64 @@ FocusScope {
618395 }
619396
620397 function showHome() {
621− var animate = !greeter.shown && !stages.shown
622− greeter.hide()
398+ if (edgeDemo.running) {
399+ return
400+ }
401+
402+ if (LightDM.Greeter.active) {
403+ if (!LightDM.Greeter.promptless) {
404+ lockscreen.show()
405+ }
406+ greeter.hide()
407+ }
408+
409+ var animate = !LightDM.Greeter.active && !stages.shown
623410 dash.setCurrentScope("clickscope", animate, false)
624− stages.hide()
411+ ApplicationManager.requestFocusApplication("unity8-dash")
412+ }
413+
414+ function showDash() {
415+ if (LightDM.Greeter.active && !LightDM.Greeter.promptless) {
416+ return;
417+ }
418+ if (greeter.shown) {
419+ greeter.hideRight();
420+ launcher.fadeOut();
421+ }
422+
423+ ApplicationManager.requestFocusApplication("unity8-dash")
424+ launcher.fadeOut();
625425 }
626426
627427 Item {
628428 id: overlay
429+ z: 10
629430
630431 anchors.fill: parent
631432
632433 Panel {
633434 id: panel
435+ objectName: "panel"
634436 anchors.fill: parent //because this draws indicator menus
635437 indicators {
636438 hides: [launcher]
637− available: edgeDemo.panelEnabled
439+ available: edgeDemo.panelEnabled && greeter.fakeActiveForApp === ""
638440 contentEnabled: edgeDemo.panelContentEnabled
639441 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
640442 panelHeight: units.gu(3)
641443 }
642− property string focusedAppId: ApplicationManager.focusedApplicationId
643− property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
644− fullscreenMode: focusedApplication && stages.fullscreen && !greeter.shown && !lockscreen.shown
645444
646− InputFilterArea {
647− anchors {
648− top: parent.top
649− left: parent.left
650− right: parent.right
651− }
652− height: (panel.fullscreenMode) ? shell.edgeSize : panel.panelHeight
653− blockInput: true
654− }
655− }
445+ property bool topmostApplicationIsFullscreen:
446+ ApplicationManager.focusedApplicationId &&
447+ ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
656448
657− InputFilterArea {
658− blockInput: launcher.shown
659− anchors {
660− top: parent.top
661− bottom: parent.bottom
662− left: parent.left
663− }
664− width: launcher.width
449+ fullscreenMode: (topmostApplicationIsFullscreen && !LightDM.Greeter.active && launcher.progress == 0)
450+ || greeter.fakeActiveForApp !== ""
665451 }
666452
667453 Launcher {
668454 id: launcher
455+ objectName: "launcher"
669456
670457 readonly property bool dashSwipe: progress > 0
671458
@@ -673,29 +460,19 @@ FocusScope {
673460 anchors.bottom: parent.bottom
674461 width: parent.width
675462 dragAreaWidth: shell.edgeSize
676− available: edgeDemo.launcherEnabled
677−
678− onShowDashHome: {
679− if (edgeDemo.running)
680− return;
681−
682− showHome()
683− }
684− onDash: {
685− if (stages.shown && !stages.overlayMode && !stages.locked) {
686− stages.hide();
687− launcher.fadeOut();
688− } else {
689− launcher.switchToNextState("visible");
690− }
463+ available: edgeDemo.launcherEnabled && greeter.fakeActiveForApp === ""
691464
692− if (greeter.shown) {
693− greeter.hideRight();
694− launcher.fadeOut();
465+ onShowDashHome: showHome()
466+ onDash: showDash()
467+ onDashSwipeChanged: {
468+ if (dashSwipe && ApplicationManager.focusedApplicationId !== "unity8-dash") {
469+ dash.setCurrentScope("clickscope", false, true)
695470 }
696471 }
697− onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)
698472 onLauncherApplicationSelected: {
473+ if (greeter.fakeActiveForApp !== "") {
474+ lockscreen.show()
475+ }
699476 if (!edgeDemo.running)
700477 shell.activateApplication(appId)
701478 }
@@ -717,11 +494,6 @@ FocusScope {
717494 MouseArea {
718495 anchors.fill: parent
719496 }
720−
721− InputFilterArea {
722− anchors.fill: parent
723− blockInput: modalNotificationBackground.visible
724− }
725497 }
726498
727499 Notifications {
@@ -747,62 +519,31 @@ FocusScope {
747519 PropertyChanges { target: notifications; width: units.gu(38) }
748520 }
749521 ]
750−
751− InputFilterArea {
752− anchors { left: parent.left; right: parent.right }
753− height: parent.contentHeight
754− blockInput: height > 0
755− }
756522 }
757523 }
758524
759− focus: true
760− onFocusChanged: if (!focus) forceActiveFocus();
761−
762− InputFilterArea {
763− anchors {
764− top: parent.top
765− bottom: parent.bottom
766− left: parent.left
767− }
768− width: shell.edgeSize
769− blockInput: true
770− }
771−
772− InputFilterArea {
773− anchors {
774− top: parent.top
775− bottom: parent.bottom
776− right: parent.right
777− }
778− width: shell.edgeSize
779− blockInput: true
780− }
781−
782525 Binding {
783526 target: i18n
784527 property: "domain"
785528 value: "unity8"
786529 }
787530
788− OSKController {
789− anchors.topMargin: panel.panelHeight
790− anchors.fill: parent // as needs to know the geometry of the shell
791− }
792−
793− //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
794− MouseArea {
795− anchors.bottom: parent.bottom
796− anchors.left: parent.left
797− anchors.right: parent.right
798− height: ApplicationManager.keyboardVisible ? ApplicationManager.keyboardHeight : 0
799−
800− enabled: ApplicationManager.keyboardVisible
531+ Dialogs {
532+ id: dialogs
533+ anchors.fill: parent
534+ z: overlay.z + 10
535+ onPowerOffClicked: {
536+ shutdownFadeOutRectangle.enabled = true;
537+ shutdownFadeOutRectangle.visible = true;
538+ shutdownFadeOut.start();
539+ }
801540 }
802541
803542 Label {
543+ id: alphaDisclaimerLabel
804544 anchors.centerIn: parent
805545 visible: ApplicationManager.fake ? ApplicationManager.fake : false
546+ z: dialogs.z + 10
806547 text: "EARLY ALPHA\nNOT READY FOR USE"
807548 color: "lightgrey"
808549 opacity: 0.2
@@ -816,11 +557,11 @@ FocusScope {
816557
817558 EdgeDemo {
818559 id: edgeDemo
560+ z: alphaDisclaimerLabel.z + 10
819561 greeter: greeter
820562 launcher: launcher
821− dash: dash
822563 indicators: panel.indicators
823− underlay: underlay
564+ stages: stages
824565 }
825566
826567 Connections {
@@ -828,35 +569,9 @@ FocusScope {
828569 onShowHome: showHome()
829570 }
830571
831− Keys.onPressed: {
832− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
833− if (!powerKeyTimer.running) {
834− powerKeyTimer.start();
835− }
836− event.accepted = true;
837− }
838− }
839−
840− Keys.onReleased: {
841− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
842− powerKeyTimer.stop();
843− event.accepted = true;
844− }
845− }
846−
847− Timer {
848− id: powerKeyTimer
849− interval: 2000
850− repeat: false
851− triggeredOnStart: false
852−
853− onTriggered: {
854− stages.showPowerDialog();
855− }
856− }
857−
858572 Rectangle {
859573 id: shutdownFadeOutRectangle
574+ z: edgeDemo.z + 10
860575 enabled: false
861576 visible: false
862577 color: "black"
@@ -873,4 +588,5 @@ FocusScope {
873588 }
874589 }
875590 }
591+
876592}