mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
libs: fix fallback in KDisplayManager::newSession()
SwitchToGreeter is method on the org.freedesktop.DisplayManager.Seat interface not org.freedesktop.DisplayManager.Session Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
57aee76feb
commit
c1ae5b77e7
1 changed files with 42 additions and 36 deletions
|
@ -204,6 +204,9 @@ void KDisplayManager::newSession()
|
|||
return;
|
||||
}
|
||||
|
||||
const QByteArray dmseatbytes = qgetenv("XDG_SEAT_PATH");
|
||||
QString dmseat = QString::fromLocal8Bit(dmseatbytes.constData(), dmseatbytes.size());
|
||||
if (dmseat.isEmpty()) {
|
||||
QDBusInterface dmiface(
|
||||
QString::fromLatin1("org.freedesktop.DisplayManager"),
|
||||
QString::fromLatin1("/org/freedesktop/DisplayManager"),
|
||||
|
@ -228,15 +231,17 @@ void KDisplayManager::newSession()
|
|||
const QString dmusername = dmsessioniface.property("UserName").toString();
|
||||
// qDebug() << Q_FUNC_INFO << dmusername << username;
|
||||
if (dmusername == username) {
|
||||
dmsessioniface.asyncCall("SwitchToGreeter");
|
||||
return;
|
||||
const QDBusObjectPath dmsessionseat = qvariant_cast<QDBusObjectPath>(dmsessioniface.property("Seat"));
|
||||
dmseat = dmsessionseat.path();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!dmseat.isEmpty()) {
|
||||
QDBusInterface lightdmiface(
|
||||
"org.freedesktop.DisplayManager",
|
||||
qgetenv("XDG_SEAT_PATH"),
|
||||
dmseat,
|
||||
"org.freedesktop.DisplayManager.Seat",
|
||||
QDBusConnection::systemBus()
|
||||
);
|
||||
|
@ -244,6 +249,7 @@ void KDisplayManager::newSession()
|
|||
lightdmiface.asyncCall("SwitchToGreeter");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
kWarning() << "No way to start new session";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue