Bug 476763

Summary: Block sleep when the logout screen is visible
Product: [Plasma] plasmashell Reporter: Fushan Wen <qydwhotmail>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: ayushkaintura1123, kde, nate, voidpointertonull+bugskdeorg
Priority: NOR Keywords: junior-jobs, usability
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Fushan Wen 2023-11-09 16:51:14 UTC
Otherwise when a user closes the lid directly and opens it again, the logout screen is still there.
Comment 1 Nate Graham 2023-11-09 20:09:07 UTC
lol
Comment 2 Pedro V 2023-11-18 09:15:14 UTC
Wasn't even sure what's the problem here first as I tried to reproduce it, closing the lid causing sleeping, opening it returning to the lock screen, the logging back in resulting in getting the whole session back including the logout screen as expected, but then I realized that the point is the idea of the logout screen being a sleep inhibitor.

I can see the following problems with that:
- I don't think even power management inhibitors get to stop the lid closing power management event, so it's a context independent action which although doesn't promise security features, I would be rather upset if my laptop stayed unlocked for any reason after closing it.
- If the problem is merely the possibility of logout having a timeout which isn't reached when closing the lid, then that's already covered by a setting: System Settings -> Startup and Shutdown -> Desktop Session -> Logout Screen -> Show

While I personally don't feel like it's a significant problem, thinking more about it, it's really unexpected behavior though as the user initiates logout which then never finishes with the default settings.
I still maintain that I wouldn't block sleeping, but it would be sensible to deal with the logout screen (without waiting for the timeout) first before sleeping. Finishing the user initiated action could be sensible (although behavior changing compared to the current state) in most cases, but then for example restart would be rather awkward that way as it would lead to the device not going to sleep, so there's no obvious solution for all cases.
Comment 3 Ayush Kaintura 2025-11-14 06:48:50 UTC
Hi all, I'm a new contributor and I’d like to work on this issue.
Also, before I start digging into the session management code, is this bug currently open for contributors?
Comment 4 Nate Graham 2025-11-14 14:51:47 UTC
Indeed; all bugs are open to anyone working on them! Please feel free. Thanks for volunteering to help!
Comment 5 Kai Uwe Broulik 2025-11-18 15:30:46 UTC
Note that "closing the lid" is always an explicit user action and cannot be blocked.

I believe we do have (or did at some point) infrastructure for avoiding a suspend while shutting down. 

If we blocked the logout screen, what would happen? User closes the lid, 30 seconds time out, then an app asks to quit and blocks suspend…? KWin does continue after a few minutes but still I am not sure this is a good idea overall.