@@ -21,28 +21,19 @@ import Unity.Application 0.1
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import Ubuntu.Gestures 0.1
22import Ubuntu.Gestures 0.1
23import Unity.Launcher 0.1
23import Unity.Launcher 0.1
24−import LightDM 0.1 as LightDM
25import Powerd 0.1
24import Powerd 0.1
26import SessionBroadcast 0.1
25import SessionBroadcast 0.1
26+import SessionManager 0.1
27import "Dash"
27import "Dash"
29import "Launcher"
28import "Launcher"
30import "Panel"
29import "Panel"
31import "Components"
30import "Components"
32import "Notifications"
31import "Notifications"
33import Unity.Notifications 1.0 as NotificationBackend
32import Unity.Notifications 1.0 as NotificationBackend
35−FocusScope {
34+BasicShell {
38− // this is only here to select the width / height of the window if not running fullscreen
39− property bool tablet: false
40− width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
41− height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
43− property real edgeSize: units.gu(2)
44− property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg")
45− property url background
46 readonly property real panelHeight: panel.panelHeight
37 readonly property real panelHeight: panel.panelHeight
48 property bool dashShown: dash.shown
39 property bool dashShown: dash.shown
@@ -78,17 +69,7 @@ FocusScope {
78 id: backgroundSettings
69 id: backgroundSettings
79 schema.id: "org.gnome.desktop.background"
70 schema.id: "org.gnome.desktop.background"
81− property url gSettingsPicture: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
72+ backgroundSource: backgroundSettings.pictureUri
82− onGSettingsPictureChanged: {
83− shell.background = gSettingsPicture
90− Keys.onVolumeUpPressed: volumeControl.volumeUp()
91− Keys.onVolumeDownPressed: volumeControl.volumeDown()
94 id: underlayClipper
75 id: underlayClipper
@@ -135,10 +116,9 @@ FocusScope {
136 objectName: "dash"
117 objectName: "dash"
138− available: !greeter.shown && !lockscreen.shown
139 hides: [stages, launcher, panel.indicators]
119 hides: [stages, launcher, panel.indicators]
140− shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0
120+ shown: disappearingAnimationProgress !== 1.0
141− enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
121+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
143 anchors {
123 anchors {
144 fill: parent
124 fill: parent
@@ -226,7 +206,6 @@ FocusScope {
226 shown = true;
206 shown = true;
227 panel.indicators.hide();
207 panel.indicators.hide();
228 edgeDemo.stopDemo();
208 edgeDemo.stopDemo();
230 if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
209 if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
231 ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
210 ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
@@ -267,6 +246,12 @@ FocusScope {
250+ target: ApplicationManager
251+ property: "suspended"
252+ value: !SessionManager.active
271 id: applicationsDisplayLoader
256 id: applicationsDisplayLoader
272 anchors.fill: parent
257 anchors.fill: parent
@@ -291,132 +276,9 @@ FocusScope {
296− objectName: "lockscreen"
298− readonly property int backgroundTopMargin: -panel.panelHeight
300− hides: [launcher, panel.indicators]
303− showAnimation: StandardAnimation { property: "opacity"; to: 1 }
304− hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
305− y: panel.panelHeight
306− x: required ? 0 : - width
308− height: parent.height - panel.panelHeight
309− background: shell.background
313− onEntered: LightDM.Greeter.respond(passphrase);
314− onCancel: greeter.show()
316− Component.onCompleted: {
317− if (LightDM.Users.count == 1) {
318− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
324− target: LightDM.Greeter
327− if (LightDM.Users.count == 1) {
328− // TODO: There's no better way for now to determine if its a PIN or a passphrase.
329− if (text == "PIN") {
330− lockscreen.alphaNumeric = false
332− lockscreen.alphaNumeric = true
334− lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
339− onAuthenticationComplete: {
340− if (LightDM.Greeter.promptless) {
343− if (LightDM.Greeter.authenticated) {
346− lockscreen.clear(true);
352− anchors.fill: parent
354− opacity: greeterWrapper.showProgress * 0.8
358− // Just a tiny wrapper to adjust greeter's x without messing with its own dragging
360− x: launcher.progress
361− y: panel.panelHeight
363− height: parent.height - panel.panelHeight
366− enabled: !launcher.dashSwipe
367− StandardAnimation {}
370− readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
374− objectName: "greeter"
377− hides: [launcher, panel.indicators]
380− defaultBackground: shell.background
383− height: parent.height
385− dragHandleWidth: shell.edgeSize
390− // If there is only one user, we start authenticating with that one here.
391− // If there are more users, the Greeter will handle that
392− if (LightDM.Users.count == 1) {
393− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
395− greeter.forceActiveFocus();
399− onUnlocked: greeter.hide()
401− // Update launcher items for new user
402− var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
403− AccountsService.user = user;
404− LauncherModel.setUser(user);
407− onTease: launcher.tease()
410− target: ApplicationManager
411− property: "suspended"
412− value: greeter.shown && greeterWrapper.showProgress == 1
417 InputFilterArea {
279 InputFilterArea {
418 anchors.fill: parent
280 anchors.fill: parent
419− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
281+ blockInput: ApplicationManager.focusedApplicationId.length === 0 || launcher.shown
420 || panel.indicators.shown
282 || panel.indicators.shown
@@ -428,7 +290,7 @@ FocusScope {
428 // We ignore any display-off signals when the proximity sensor
290 // We ignore any display-off signals when the proximity sensor
429 // is active. This usually indicates something like a phone call.
291 // is active. This usually indicates something like a phone call.
430 if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
292 if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
431− greeter.showNow();
293+ SessionManager.lock();
434 // No reason to chew demo CPU when user isn't watching
296 // No reason to chew demo CPU when user isn't watching
@@ -440,17 +302,12 @@ FocusScope {
443− function showHome() {
305+ function showHome(fromLauncher) {
444− var animate = !greeter.shown && !stages.shown
306+ var animate = fromLauncher && !stages.shown
446 dash.setCurrentScope("clickscope", animate, false)
307 dash.setCurrentScope("clickscope", animate, false)
447 stages.hide()
308 stages.hide()
450− function hideIndicatorMenu(delay) {
451− panel.hideIndicatorMenu(delay);
455 id: overlay
312 id: overlay
@@ -467,8 +324,8 @@ FocusScope {
468 property string focusedAppId: ApplicationManager.focusedApplicationId
325 property string focusedAppId: ApplicationManager.focusedApplicationId
469 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
326 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
470− fullscreenMode: focusedApplication && stages.fullscreen && !greeter.shown && !lockscreen.shown
327+ fullscreenMode: focusedApplication && stages.fullscreen
471− searchVisible: !greeter.shown && !lockscreen.shown && dash.shown && dash.searchable
328+ searchVisible: dash.shown && dash.searchable
473 InputFilterArea {
330 InputFilterArea {
474 anchors {
331 anchors {
@@ -506,8 +363,9 @@ FocusScope {
506 if (edgeDemo.running)
363 if (edgeDemo.running)
509− showHome()
366+ showHome(true)
511 onDash: {
369 onDash: {
512 if (stages.shown && !stages.overlayMode) {
370 if (stages.shown && !stages.overlayMode) {
513 if (!stages.locked) {
371 if (!stages.locked) {
@@ -515,10 +373,6 @@ FocusScope {
515 launcher.hide();
373 launcher.hide();
518− if (greeter.shown) {
519− greeter.hideRight();
523 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)
377 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)
524 onLauncherApplicationSelected: {
378 onLauncherApplicationSelected: {
@@ -535,7 +389,7 @@ FocusScope {
535 Rectangle {
389 Rectangle {
536 id: modalNotificationBackground
390 id: modalNotificationBackground
538− visible: notifications.useModal && !greeter.shown && (notifications.state == "narrow")
392+ visible: notifications.useModal && (notifications.state == "narrow")
539 color: "#000000"
393 color: "#000000"
540 anchors.fill: parent
394 anchors.fill: parent
541 opacity: 0.5
395 opacity: 0.5
@@ -582,10 +436,17 @@ FocusScope {
582 blockInput: height > 0
436 blockInput: height > 0
587− focus: true
440+ Connections {
588− onFocusChanged: if (!focus) forceActiveFocus();
441+ target: SessionManager
443+ if (!SessionManager.active) {
445+ panel.indicators.hide()
590 InputFilterArea {
451 InputFilterArea {
591 anchors {
452 anchors {
@@ -607,12 +468,6 @@ FocusScope {
607 blockInput: true
468 blockInput: true
616 OSKController {
471 OSKController {
617 anchors.topMargin: panel.panelHeight
472 anchors.topMargin: panel.panelHeight
618 anchors.fill: parent // as needs to know the geometry of the shell
473 anchors.fill: parent // as needs to know the geometry of the shell
@@ -644,7 +499,6 @@ FocusScope {
645 EdgeDemo {
500 EdgeDemo {
646 id: edgeDemo
501 id: edgeDemo
648 launcher: launcher
502 launcher: launcher
649 dash: dash
503 dash: dash
650 indicators: panel.indicators
504 indicators: panel.indicators
@@ -653,6 +507,6 @@ FocusScope {
654 Connections {
508 Connections {
655 target: SessionBroadcast
509 target: SessionBroadcast
656− onShowHome: showHome()
510+ onShowHome: showHome(false)