@@ -243,8 +243,8 @@ DBusUnitySessionService::DBusUnitySessionService()
243 : UnityDBusObject(QStringLiteral("/com/canonical/Unity/Session"), QStringLiteral("com.canonical.Unity"))
243 : UnityDBusObject(QStringLiteral("/com/canonical/Unity/Session"), QStringLiteral("com.canonical.Unity"))
245 if (!d->logindSessionPath.isEmpty()) {
245 if (!d->logindSessionPath.isEmpty()) {
246− // connect our Lock() slot to the logind's session Lock() signal
246+ // connect our PromptLock() slot to the logind's session Lock() signal
247− QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Lock"), this, SLOT(Lock()));
247+ QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Lock"), this, SLOT(PromptLock()));
248 // ... and our Unlocked() signal to the logind's session Unlock() signal
248 // ... and our Unlocked() signal to the logind's session Unlock() signal
249 // (lightdm handles the unlocking by calling logind's Unlock method which in turn emits this signal we connect to)
249 // (lightdm handles the unlocking by calling logind's Unlock method which in turn emits this signal we connect to)
250 QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Unlock"), this, SIGNAL(Unlocked()));
250 QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Unlock"), this, SIGNAL(Unlocked()));
@@ -332,15 +332,38 @@ QString DBusUnitySessionService::HostName() const
333void DBusUnitySessionService::PromptLock()
333void DBusUnitySessionService::PromptLock()
335+ // Fast lock (no animation)
335 Q_EMIT LockRequested();
336 Q_EMIT LockRequested();
336 Q_EMIT lockRequested();
337 Q_EMIT lockRequested();
339void DBusUnitySessionService::Lock()
340void DBusUnitySessionService::Lock()
341− // signal u8 to show the lockscreen/greeter
342+ // Slower lock (with animation)
343+ // FIXME: We also -- as a bit of a hack around indicator-session not fully
344+ // supporting a phone profile -- switch to greeter here. The unity7 flow is
345+ // that the user chooses "Lock/Switch" from the indicator, and then can go
346+ // to greeter by selecting "Switch" again from the indicator, which is now
347+ // exposed by the desktop_lockscreen profile. But since in unity8, we try
348+ // to expose most things all the time, we don't use the separate lockscreen
349+ // profile. Instead, we just go directly to the greeter the first time
350+ // a user presses "Lock/Switch". This isn't what this DBus call is
351+ // supposed to do, but we can live with it for now.
353+ // Here's a bug about indicator-session growing a converged Touch profile:
354+ // https://launchpad.net/bugs/1557716
356+ // We only do this here in the animated-lock call because that's the only
357+ // time the indicator locks without also asking the display manager to
358+ // switch sessions on us. And since we are switching screens, we also
359+ // don't bother respecting the animate request, simply doing a PromptLock.
342 PromptLock();
362 PromptLock();
365+void DBusUnitySessionService::switchToGreeter()
344 // lock the session using the org.freedesktop.DisplayManager system DBUS service
367 // lock the session using the org.freedesktop.DisplayManager system DBUS service
345 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
368 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
346 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
369 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
@@ -486,7 +509,7 @@ void DBusGnomeScreensaverWrapper::SetActive(bool lock)
487void DBusGnomeScreensaverWrapper::Lock()
510void DBusGnomeScreensaverWrapper::Lock()
489− performAsyncUnityCall(QStringLiteral("Lock"));
512+ performAsyncUnityCall(QStringLiteral("PromptLock"));
492quint32 DBusGnomeScreensaverWrapper::GetActiveTime() const
515quint32 DBusGnomeScreensaverWrapper::GetActiveTime() const
@@ -523,7 +546,7 @@ bool DBusScreensaverWrapper::SetActive(bool lock)
524void DBusScreensaverWrapper::Lock()
547void DBusScreensaverWrapper::Lock()
526− performAsyncUnityCall(QStringLiteral("Lock"));
549+ performAsyncUnityCall(QStringLiteral("PromptLock"));
529quint32 DBusScreensaverWrapper::GetActiveTime() const
552quint32 DBusScreensaverWrapper::GetActiveTime() const