Skip to content

Commit 4f1f1f5

Browse files
committed
Run Wayland sessions through the wayland-session script
Issue: #419
1 parent 9cda5d8 commit 4f1f1f5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/common/Session.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ namespace SDDM {
7777
};
7878

7979
inline QDataStream &operator<<(QDataStream &stream, const Session &session) {
80-
const quint32 type = static_cast<quint32>(session.type());
81-
stream << type << session.fileName();
80+
stream << quint32(session.type()) << session.fileName();
8281
return stream;
8382
}
8483

src/helper/UserSession.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ namespace SDDM {
4141
bool UserSession::start() {
4242
QProcessEnvironment env = qobject_cast<HelperApp*>(parent())->session()->processEnvironment();
4343

44-
if (env.value("XDG_SESSION_CLASS") == "greeter")
44+
if (env.value("XDG_SESSION_CLASS") == QStringLiteral("greeter")) {
4545
QProcess::start(m_path);
46-
else {
46+
} else if (env.value("XDG_SESSION_TYPE") == QStringLiteral("x11")) {
4747
qDebug() << "Starting:" << mainConfig.XDisplay.SessionCommand.get()
4848
<< m_path;
4949
QProcess::start(mainConfig.XDisplay.SessionCommand.get(),
5050
QStringList() << m_path);
51+
} else if (env.value("XDG_SESSION_TYPE") == QStringLiteral("wayland")) {
52+
qDebug() << "Starting:" << mainConfig.WaylandDisplay.SessionCommand.get()
53+
<< m_path;
54+
QProcess::start(mainConfig.WaylandDisplay.SessionCommand.get(),
55+
QStringList() << m_path);
56+
} else {
57+
qCritical() << "Unable to run user session: unknown session type";
5158
}
5259

5360
return waitForStarted();

0 commit comments

Comments
 (0)