You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sddm/1305.patch

88 lines
3.7 KiB

From 2a4d84ec01abb7d59bcba0af36a1dc5ccee12055 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
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 ab25822b..f8c91450 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 99497d10..d8ece80c 100644
--- a/src/daemon/Display.cpp
+++ b/src/daemon/Display.cpp
@@ -122,10 +122,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 655f793d..1953c76a 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() {