Summary: | Powerdevil doesn't send SimulateUserActivity() signal to screensaver | ||
---|---|---|---|
Product: | [Frameworks and Libraries] solid | Reporter: | Martin Bednar <martin+kde> |
Component: | powermanagement | Assignee: | Dario Freddi <drf> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | lamarque, michel |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.6.3 | |
Attachments: | Fix SimulateUserActivity not working. |
Description
Martin Bednar
2011-03-29 22:58:50 UTC
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 |