@@ -243,8 +243,8 @@ DBusUnitySessionService::DBusUnitySessionService()
243243 : UnityDBusObject(QStringLiteral("/com/canonical/Unity/Session"), QStringLiteral("com.canonical.Unity"))
244244{
245245 if (!d->logindSessionPath.isEmpty()) {
246− // connect our Lock() slot to the logind's session Lock() signal
247− QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Lock"), this, SLOT(Lock()));
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(PromptLock()));
248248 // ... and our Unlocked() signal to the logind's session Unlock() signal
249249 // (lightdm handles the unlocking by calling logind's Unlock method which in turn emits this signal we connect to)
250250 QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Unlock"), this, SIGNAL(Unlocked()));
@@ -332,15 +332,38 @@ QString DBusUnitySessionService::HostName() const
332332
333333void DBusUnitySessionService::PromptLock()
334334{
335+ // Fast lock (no animation)
335336 Q_EMIT LockRequested();
336337 Q_EMIT lockRequested();
337338}
338339
339340void DBusUnitySessionService::Lock()
340341{
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.
352+ //
353+ // Here's a bug about indicator-session growing a converged Touch profile:
354+ // https://launchpad.net/bugs/1557716
355+ //
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.
360+ switchToGreeter();
361+
342362 PromptLock();
363+}
343364
365+void DBusUnitySessionService::switchToGreeter()
366+{
344367 // lock the session using the org.freedesktop.DisplayManager system DBUS service
345368 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
346369 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
@@ -486,7 +509,7 @@ void DBusGnomeScreensaverWrapper::SetActive(bool lock)
486509
487510void DBusGnomeScreensaverWrapper::Lock()
488511{
489− performAsyncUnityCall(QStringLiteral("Lock"));
512+ performAsyncUnityCall(QStringLiteral("PromptLock"));
490513}
491514
492515quint32 DBusGnomeScreensaverWrapper::GetActiveTime() const
@@ -523,7 +546,7 @@ bool DBusScreensaverWrapper::SetActive(bool lock)
523546
524547void DBusScreensaverWrapper::Lock()
525548{
526− performAsyncUnityCall(QStringLiteral("Lock"));
549+ performAsyncUnityCall(QStringLiteral("PromptLock"));
527550}
528551
529552quint32 DBusScreensaverWrapper::GetActiveTime() const