Bug 369137

Summary: Time spent on a different VT does not count against the "time until screen lock" duration
Product: [Plasma] kscreenlocker Reporter: zless <arthur>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: bhush94, bugseforuns, jw, kde, mgraesslin, nate, notuxius, plasma-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description zless 2016-09-21 03:55:58 UTC
The laptop sits idle on tty2 and KDE is started on tty1.

When switching back to the desktop on tty1 the screen is not locked even after the configured timeout of 5 minutes passes.


Reproducible: Always

Steps to Reproduce:
1. I start the desktop on tty1 with startx (no desktop manager like sddm). Xorg is started as a user process not under root (xorg 1.18.4).
2. I switch to another tty an run another user xorg with kodi
3. I exit kodi on tty2 and the shell automatically logs out.
4. After a few hours I switch to tty1 with KDE and the screen is still unlocked.



Expected Results:  
The plasma screen should be locked after the configured inactivity timeout (5 min in my case).
Comment 1 Kai Uwe Broulik 2016-09-21 06:25:17 UTC
The session is probably frozen. There's a conflict here. We don't want to suspend the session when switching over to it either. Just use proper means to switch the session (that is *not* Ctrl+Alt+F key) and it will lock the session properly before switching.
Comment 2 Martin Flöser 2016-10-18 09:28:23 UTC
Just tried how this behaves on Wayland: there we get the screen locked, but rendering breaks completely. It means that KIdleTime doesn't fire if not on the current vt on X11. Doesn't surprise me really.

I don't really know what we can do about it. If X does not notify us, it doesn't notify us. Not much we can do about it.

What could be done is adding a new option whether to lock the screen when switching vts.
Comment 3 Alexander Mentyu 2018-07-18 08:11:14 UTC
"The screen locker is broken and unlocking is not possible anymore..." message is shown on the graphical vt after switching to console vt, waiting 5min for screen locking and switching back. Wayland session

Distribution: Netrunner Rolling
Kernel: 4.18.0-1-MANJARO
Plasma: 5.13.3
Apps: 18.04.3
Qt: 5.11.1
Frameworks: 5.48.0
Wayland: 1.15.0
Graphics:  Card-1: Intel Haswell-ULT Integrated Graphics driver: i915 v: kernel bus ID: 00:02.0 
           chip ID: 8086:0a16 
           Display: wayland server: X.Org 1.20.0 driver: intel unloaded: modesetting compositor: kwin_wayland 
           tty: N/A 
           OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.1.4 compat-v: 3.0 direct render: Yes
Comment 4 Patrick Silva 2019-03-25 18:59:40 UTC
I can't confirm at least on X11.
I had plasma running on tty1, I switched to tty2 and logged-in using another user account. So I switched back to tty1 after the screen locking timeout, I could see plasma for a few milliseconds and then the screen was blocked.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 5 Josef Wolf 2020-03-25 12:42:29 UTC
> 2. I switch to another tty an run another user xorg with kodi
> 3. I exit kodi on tty2 and the shell automatically logs out.
The bug occurs not only when kodi is used. It appears always when the display is switched to any virtual terminal.

> Just use proper means to switch the session (that is *not* Ctrl+Alt+F key)
Please explain why CTRL-ALT-Fx is not a proper way to switch virtual terminals. This has been the primary way to switch terminals since the very first versions of linux.

> and it will lock the session properly before switching.
No, it won't! The problem occurs even when using the "Switch user" or the "New Session" functionalities.

> I don't really know what we can do about it. If X does not notify
> us, it doesn't notify us. Not much we can do about it.
It works fine with gdm, and it worked fine with kde4. Thus, there must be some way to get those notifications.


I can reproduce the problem with opensuse-15.1 and ubuntu-18.04.

Problem does appear with sddm, lightdm and kdm

Problem does not seem to appear with gdm and xfce

Please also check out https://bugzilla.opensuse.org/show_bug.cgi?id=1166496
Comment 6 Christoph Feck 2020-04-15 07:39:16 UTC
*** Bug 419216 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2022-11-04 20:57:14 UTC
Thank you for reporting this issue in KDE software. As it has been a while since it was reported, can we please ask you to see if you can reproduce the issue with a recent software version? Like Plasma 5.25, or ideally 5.26?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 8 Bug Janitor Service 2022-11-19 05:13:29 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2022-12-04 05:15:04 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!