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
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.
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.
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.
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.