Version: unspecified (using KDE 4.6.1) OS: Linux When I resume my PC with screen locking enabled, I expect to be directly asked for a password. Right now I need to move the mouse/press a key to get to the password dialog. Reproducible: Didn't try Steps to Reproduce: Suspend with screen locking enabled, resume Actual Results: if no screen saver is set, black screen. Expected Results: if no screen saver is set, black screen with password prompt. The code is there (powerdevilcore.cpp:536) but apparently doesn't work... I tried catching the resumingFromSuspend() signal, that worked fine. Sending SimulateUserActivity() to the screensaver also works.
forgot to select Reproducible: Every time
Created attachment 58449 [details] Fix SimulateUserActivity not working. It seems there is a race condition between the Lock and SimulateUserActivity calls. If the SimulateUserActivity starts before the Lock call has taken effect te SimulateUserActivity is ignored. You can see this using: qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock ; sleep 0.5; qdbus org.freedesktop.ScreenSaver /ScreenSaver SimulateUserActivity with sleep < 1s SimulateUserActivity has not effect. I think the same thing happens during the suspend -> resume cicle. The attached patch fix this. I just wanted someone else to look at it and see if we can improve it.
this is a rather horrid hack. it shouldn't be too hard to queue up the activity request in the screenlocker itself (there is already a --showunlock command line option). technically, it's also a bug that the sleep is started before the lock has fully kicked in, but that may be hard to fix - http://lists.kde.org/?l=kde-devel&m=127854133109321&w=2
I tried adding --showunlock as a parameter to kscreenlocker in kde-workspace/krunner/screensaver/saverengine.cpp but it did not work. It locks the screen but still does not show the unlock dialog.
that would be wrong anyway, as the regular Lock() is not supposed to pop it up. you need to fix the race inside the locker, and the feature was just a hint that there is already some relevant code.
Git commit 5c47f16d67065e239c380cc369a1da854acef19a by Lamarque V. Souza. Committed on 09/04/2011 at 07:44. Pushed by lvsouza into branch 'KDE/4.6'. Fix SimulateUserActivity not working for a second when resuming from ram/disk. The problem is in krunner/lock/lockprocess.cc, LockProcess::lock(...), lines: mBusy = true; ... QTimer::singleShot(1000, this, SLOT(slotDeadTimePassed())); The "dead-time" makes LockProcess ignores any SimulateUserActivity requests during that one second-time. I have added "mInitialLock = true" in LockProcess::signalPipeSignal() to simulate the "--showunlock" parameter after the one second-time. BUG: 269737 FIXED-IN: 4.6.3 M +2 -0 krunner/lock/lockprocess.cc http://commits.kde.org/kde-workspace/5c47f16d67065e239c380cc369a1da854acef19a
Git commit 49ecb2b9e1d340c799faaff0ea50ed5424217729 by Lamarque V. Souza. Committed on 09/04/2011 at 07:44. Pushed by lvsouza into branch 'master'. Fix SimulateUserActivity not working for a second when resuming from ram/disk. The problem is in krunner/lock/lockprocess.cc, LockProcess::lock(...), lines: mBusy = true; ... QTimer::singleShot(1000, this, SLOT(slotDeadTimePassed())); The "dead-time" makes LockProcess ignores any SimulateUserActivity requests during that one second-time. I have added "mInitialLock = true" in LockProcess::signalPipeSignal() to simulate the "--showunlock" parameter after the one second-time. BUG: 269737 FIXED-IN: 4.6.3 M +2 -0 krunner/lock/lockprocess.cc http://commits.kde.org/kde-workspace/49ecb2b9e1d340c799faaff0ea50ed5424217729
*** Bug 89138 has been marked as a duplicate of this bug. ***