Version: unspecified (using Devel) OS: Linux Per https://bugs.kde.org/show_bug.cgi?id=289760#c70, it is no longer possible to suspend while apper-sentinel is running because it is inhibiting suspend if it is running, whether there are active PackageKit activities or not Reproducible: Always Steps to Reproduce: # have the apper subsystem running # Set up some powermanager actions (suspend on laptop lid closed, F.E.) # trigger action Actual Results: kded(1515) PowerDevil::PolicyAgent::AddInhibition: DBus service ":1.285" is requesting inhibition kded(1515) PowerDevil::PolicyAgent::AddInhibition: Added inhibition with cookie 2 from "ApperSentinel" with "" kded(1515) PowerDevil::PolicyAgent::addInhibitionTypeHelper: Added interrupt session Apper prevents PowerDevil from following through with the action regardless of what is happening Expected Results: Apper should only inhibit when there are activities in progress which could be dangerous to interrupt, such as updates or installations
Well actually it only grabs a cookie when something is running... But really this never really worked reliable, because for some reason power devil seemed not to work properly. I really thing this is a bug in power devil not Apper, since the code is rather simple, grab cookie drop cookie. All tests I did this didn't work well
Adding Dario as CC, can you two sort this out? I'm just a peoplemover, not a codemover :)
sure I asked Dario about this once, he said he found the bug and fixed but I really never managed to see this working right even after... Maybe my code has a bug but the mechanism is rather simple.
I might have a look at this today, now pd is fixed so the problem is on the other side. Can you please point me at the routine where inhibit is triggered?
https://projects.kde.org/projects/playground/sysadmin/apper/repository/revisions/master/entry/Sentinel/TransactionWatcher.cpp Thanks.
void TransactionWatcher::transactionListChanged(const QStringList &tids) // release any cookie that we might have 93 suppressSleep(true); Maybe you meant false? :)
hmm right that might be the problem, tho I think I set that to true because it wasn't suppressing sleep... Can you point me how to make sure it is suppressing sleep? ie not suspend when lid closed or something?
That one should be indeed false. The routine is correct apart from that, as your comment also suggests - when no transactions are running, you should release your inhibition. The overall code is fine, it's a mere logical error. The reason why it didn't work for you was probably because inhibition was pretty much broken before 4.8, I suppose.
Right, and now that it is working we have bug reports :P I'll fix that and include in the upcoming version... Thanks.
Can you CCBUG your commit to this one? I know rdieter is looking to get KDE 4.8 in to Fedora 17 and having this bug addressed before then (even with a manual backport in to the current stable) would probably be a Good Thing for us.
@Ryan: if you are in a real hurry, you just s/suppressSleep(true);/suppressSleep(false);/g in the line I pointed you to (93 in the file Daniel mentioned) and be happy :)
Bug fixed in: http://commits.kde.org/apper/8e43cddd2634b03ee5a05f5287792bb006e903f8 Thanks for reporting it :D