[PATCH] Do not show logout screen when in lockscreen / screensaver
authorNiccolò Venerandi <niccolo@venerandi.com>
Mon, 2 Jun 2025 11:35:03 +0000 (11:35 +0000)
committerAurélien COUDERC <coucouf@debian.org>
Mon, 21 Jul 2025 16:21:10 +0000 (18:21 +0200)
BUG:504575

(cherry picked from commit ba7a8c16b7934fa23d3a44bb38667554e39996b7)

Co-authored-by: Niccolò Venerandi <niccolo@venerandi.com>
Gbp-Pq: Name upstream_f1605df4_Do-not-show-logout-screen-when-in-lockscreen-screensaver.patch

libkworkspace/sessionmanagement.cpp

index 43a21259174bddae54c7c517c37f8d6555757557..248147f50555a2ccf4f33a280885996dcdd69782 100644 (file)
@@ -148,11 +148,18 @@ void SessionManagement::requestLogoutPrompt()
         return;
     }
 
-    // Don't bother to check for whether the user normally wants confirmation or
-    // not; if this function was invoked, it means they do want to see the logout
-    // prompt right now
-    LogoutPromptIface iface;
-    lockQuitUntilFinished(iface.promptAll());
+    OrgFreedesktopScreenSaverInterface ifaceScreenSaver(QStringLiteral("org.freedesktop.ScreenSaver"),
+                                                        QStringLiteral("/ScreenSaver"),
+                                                        QDBusConnection::sessionBus());
+
+    // Do not show Logoup prompt when in the lockscreen / screensaver
+    if (!ifaceScreenSaver.GetActive()) {
+        // Don't bother to check for whether the user normally wants confirmation or
+        // not; if this function was invoked, it means they do want to see the logout
+        // prompt right now
+        LogoutPromptIface iface;
+        lockQuitUntilFinished(iface.promptAll());
+    }
 }
 
 void SessionManagement::requestShutdown(ConfirmationMode confirmationMode)