Bug 309051

Summary: xscreensaver: screen does not lock if switched to virtual terminal
Product: [Unmaintained] kscreensaver Reporter: Adrien <perso>
Component: generalAssignee: kscreensaver bugs tracking <kscreensaver-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: wishlist CC: mgraesslin, oliver.henshaw, travisgevans
Priority: NOR    
Version: 4.8.4   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on: 318461    
Bug Blocks:    

Description Adrien 2012-10-26 15:29:56 UTC
Hi,

If you are switched to a virtual terminal e.g. ctrl-alt-f1 then the X
session does not lock automatically.

This bug was reported on the Debian Bug Tracker a long time ago :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520633

Reproducible: Always

Steps to Reproduce:
- switch to a virtual terminal (with ctrl+alt+f1)
- switch back to the X session
Actual Results:  
The screen is not locked.

Expected Results:  
The screen may be automatically locked
Comment 1 Travis Evans 2013-02-28 05:35:41 UTC
I had this issue once upon a time (a long time ago on an older distro) but didn't again until just recently. The locker always worked when I was switched to a different terminal. Starting just a couple of days ago, the automatic locker again mysteriously only works when the KDE session is the active terminal. The only change to my system that has occurred just before this stopped working was migrating to systemd, but I don't see why that should have anything to do with it.

It does lock manually, and if I run a command like
sleep 10; qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
in a terminal and immediately switch to a virtual terminal before the lock, and switch back later, the screen is locked as it should be. I fail to find any relevant messages in ~/.xsession-errors, either. It's as if it simply doesn't even try to lock the screen if it's not the active terminal.
Comment 2 Travis Evans 2013-02-28 08:36:32 UTC
I found that going into screen saver settings and setting up locking there causes the screen to lock when switched to a different terminal. But if I only set in to lock under “Suspend Session” in the energy saving settings, I experience the bug.

I don't really understand why there are two independent options in two completely different places that apparently are supposed to perform the same functionality. That's just confusing, especially when there are subtle differences in behavior for no apparent reason.
Comment 3 Oliver Henshaw 2013-03-04 16:55:51 UTC
PowerDevil PolicyAgent::requirePolicyCheck disallows the action if the session is not active. This doesn't make much sense when the action is to lock the screen.

However, as mentioned, maybe powerdevil and the screensaver shouldn't both be locking the screen on idle.

I haven't thought about it much, but maybe the session could be locked when the session becomes inactive. That might displease people who are used to switching sessions by switching virtual terminals, though.
Comment 4 Martin Flöser 2015-01-23 09:28:09 UTC
Unfortunately there is not much we can do here. Ctrl+Alt+Fx are handled in a lower layer and the session doesn't notice it.

My suggestion is to move the functionality into logind: e.g. logind should send out the lock session signal if the session gets changed.