From 994fa67b01ccfac1aaac08572302bbbea7842dc3 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sun, 18 Oct 2020 19:33:52 -0400 Subject: [PATCH] Prefer Wayland sessions over X11 ones As a general goal and preference, we want to make the change to Wayland as the default and X11 as the fallback. This change codifies that preference. Reference: https://fedoraproject.org/wiki/Changes/WaylandByDefaultForPlasma --- src/common/Session.cpp | 8 ++++---- src/daemon/Display.cpp | 6 +++--- src/greeter/SessionModel.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/Session.cpp b/src/common/Session.cpp index ab25822b5..f8c91450f 100644 --- a/src/common/Session.cpp +++ b/src/common/Session.cpp @@ -131,14 +131,14 @@ namespace SDDM { m_desktopNames.clear(); switch (type) { - case X11Session: - m_dir = QDir(mainConfig.X11.SessionDir.get()); - m_xdgSessionType = QStringLiteral("x11"); - break; case WaylandSession: m_dir = QDir(mainConfig.Wayland.SessionDir.get()); m_xdgSessionType = QStringLiteral("wayland"); break; + case X11Session: + m_dir = QDir(mainConfig.X11.SessionDir.get()); + m_xdgSessionType = QStringLiteral("x11"); + break; default: m_xdgSessionType.clear(); break; diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp index 4a5e267d4..bd91446cc 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -115,10 +115,10 @@ namespace SDDM { if (autologinSession.isEmpty()) { autologinSession = stateConfig.Last.Session.get(); } - if (findSessionEntry(mainConfig.X11.SessionDir.get(), autologinSession)) { - sessionType = Session::X11Session; - } else if (findSessionEntry(mainConfig.Wayland.SessionDir.get(), autologinSession)) { + if (findSessionEntry(mainConfig.Wayland.SessionDir.get(), autologinSession)) { sessionType = Session::WaylandSession; + } else if (findSessionEntry(mainConfig.X11.SessionDir.get(), autologinSession)) { + sessionType = Session::X11Session; } else { qCritical() << "Unable to find autologin session entry" << autologinSession; return false; diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp index 655f793d0..1953c76a2 100644 --- a/src/greeter/SessionModel.cpp +++ b/src/greeter/SessionModel.cpp @@ -41,8 +41,8 @@ namespace SDDM { SessionModel::SessionModel(QObject *parent) : QAbstractListModel(parent), d(new SessionModelPrivate()) { // initial population beginResetModel(); - populate(Session::X11Session, mainConfig.X11.SessionDir.get()); populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get()); + populate(Session::X11Session, mainConfig.X11.SessionDir.get()); endResetModel(); // refresh everytime a file is changed, added or removed @@ -50,12 +50,12 @@ namespace SDDM { connect(watcher, &QFileSystemWatcher::directoryChanged, [this](const QString &path) { beginResetModel(); d->sessions.clear(); - populate(Session::X11Session, mainConfig.X11.SessionDir.get()); populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get()); + populate(Session::X11Session, mainConfig.X11.SessionDir.get()); endResetModel(); }); - watcher->addPath(mainConfig.X11.SessionDir.get()); watcher->addPath(mainConfig.Wayland.SessionDir.get()); + watcher->addPath(mainConfig.X11.SessionDir.get()); } SessionModel::~SessionModel() {