Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:PowerPC
sddm
0003-Load-autologin-configuration-in-Display-Di...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0003-Load-autologin-configuration-in-Display-Display.patch of Package sddm
From 8fbb69ab2cfe0f8ab4c8ca31fa0f571ba165b16d Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Mon, 15 Jul 2024 21:13:35 +0200 Subject: [PATCH 3/5] Load autologin configuration in Display::Display Makes m_autologinSession more easily available and simplifies runtime handling. --- src/daemon/Display.cpp | 53 +++++++++++++++++++----------------------- src/daemon/Display.h | 3 ++- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp index 91e4dac..56b9b8a 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -171,6 +171,27 @@ namespace SDDM { stop(); }); connect(m_greeter, &Greeter::displayServerFailed, this, &Display::displayServerFailed); + + // Load autologin configuration (whether to autologin, user, session, session type) + if ((daemonApp->first || mainConfig.Autologin.Relogin.get()) && + !mainConfig.Autologin.User.get().isEmpty()) { + // reset first flag + daemonApp->first = false; + + // determine session type + QString autologinSession = mainConfig.Autologin.Session.get(); + // not configured: try last successful logged in + if (autologinSession.isEmpty()) { + autologinSession = stateConfig.Last.Session.get(); + } + if (findSessionEntry(mainConfig.Wayland.SessionDir.get(), autologinSession)) { + m_autologinSession.setTo(Session::WaylandSession, autologinSession); + } else if (findSessionEntry(mainConfig.X11.SessionDir.get(), autologinSession)) { + m_autologinSession.setTo(Session::X11Session, autologinSession); + } else { + qCritical() << "Unable to find autologin session entry" << autologinSession; + } + } } Display::~Display() { @@ -213,31 +234,6 @@ namespace SDDM { return m_displayServer->start(); } - bool Display::attemptAutologin() { - Session::Type sessionType = Session::X11Session; - - // determine session type - QString autologinSession = mainConfig.Autologin.Session.get(); - // not configured: try last successful logged in - if (autologinSession.isEmpty()) { - autologinSession = stateConfig.Last.Session.get(); - } - 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; - } - - Session session; - session.setTo(sessionType, autologinSession); - - m_auth->setAutologin(true); - return startAuth(mainConfig.Autologin.User.get(), QString(), session); - } - void Display::startSocketServerAndGreeter() { // start socket server m_socketServer->start(m_displayServer->display()); @@ -276,13 +272,12 @@ namespace SDDM { // log message qDebug() << "Display server started."; - if ((daemonApp->first || mainConfig.Autologin.Relogin.get()) && - !mainConfig.Autologin.User.get().isEmpty()) { + if (m_autologinSession.isValid()) { // reset first flag daemonApp->first = false; - const bool autologinStarted = attemptAutologin(); - if (!autologinStarted) + m_auth->setAutologin(true); + if (!startAuth(mainConfig.Autologin.User.get(), QString(), m_autologinSession)) handleAutologinFailure(); return; diff --git a/src/daemon/Display.h b/src/daemon/Display.h index b215852..d0b23c4 100644 --- a/src/daemon/Display.h +++ b/src/daemon/Display.h @@ -72,7 +72,6 @@ namespace SDDM { void login(QLocalSocket *socket, const QString &user, const QString &password, const Session &session); - bool attemptAutologin(); void displayServerStarted(); signals: @@ -103,6 +102,8 @@ namespace SDDM { QString m_sessionName; QString m_reuseSessionId; + Session m_autologinSession; + Auth *m_auth { nullptr }; DisplayServer *m_displayServer { nullptr }; Seat *m_seat { nullptr }; -- 2.46.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor