File 0004-Reset-daemonApp-first-in-the-Display-constructor.patch of Package sddm

From ee66831cd420cf2b35b6a91d0d0afe57b11b2dd2 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Mon, 15 Jul 2024 21:19:58 +0200
Subject: [PATCH 4/5] Reset daemonApp->first in the Display constructor

Simplifies the code and makes really sure that only the first display has
this set.
---
 src/daemon/Display.cpp | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp
index 56b9b8a..9167ebf 100644
--- a/src/daemon/Display.cpp
+++ b/src/daemon/Display.cpp
@@ -175,9 +175,6 @@ namespace SDDM {
         // 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
@@ -192,6 +189,9 @@ namespace SDDM {
                 qCritical() << "Unable to find autologin session entry" << autologinSession;
             }
         }
+
+        // reset first flag
+        daemonApp->first = false;
     }
 
     Display::~Display() {
@@ -254,9 +254,6 @@ namespace SDDM {
 
         // start greeter
         m_greeter->start();
-
-        // reset first flag
-        daemonApp->first = false;
     }
 
     void Display::handleAutologinFailure() {
@@ -273,9 +270,6 @@ namespace SDDM {
         qDebug() << "Display server started.";
 
         if (m_autologinSession.isValid()) {
-            // reset first flag
-            daemonApp->first = false;
-
             m_auth->setAutologin(true);
             if (!startAuth(mainConfig.Autologin.User.get(), QString(), m_autologinSession))
                 handleAutologinFailure();
-- 
2.46.0

openSUSE Build Service is sponsored by