Add ConsoleKit2 as a power backend
Review Request #124388 - Created July 19, 2015 and submitted
Internally, it uses the login1 interface with ConsoleKit2 since they share identical DBUS calls. It also changes the setupSystemdInhibition to setupSeatManagerInhibition so that the login1 and ConsoleKit2 inhibit calls to minimize code duplication.
This patch doesn't modify the build system to keep it small. A future patch can be added to use ConsoleKit2 on BSD systems as well.
ConsoleKit2's suspend/hibernate/inhibit DBUS API is documented at: http://consolekit2.github.io/ConsoleKit2/#Manager
Built powerdevil with patch and pkla files on a Gentoo system with OpenRC. Before patch there was no suspend option, after there was and clicking it resulted in the system properly suspending.
Cool. Thanks for this.
FYI we're hoping to drop the ConsoleKit 1 support in Plasma 5.5; so that should hopefully simplify this moving forwards as we end up with a single API and just loading the same object on potentially two different paths.
May I ask you a favor? Could you please try whether you can get kwin_wayland (drm/libinput) to work with consolekit2? That would be totally awesome!
Of course I'm also interested in consolekit2 addons to screen locker if there are changes needed to get the same level of integration as with logind (it currently listens to logind for lock/unlock signals and inhibits suspend to ensure the lock screen is in place before the system goes to sleep state).
Rebased on master, removed consolekit2InhibitFd. When trying to consolidate the code I noticed that daemon/actions/bundled/suspendsession.cpp calls setupSystemdInhibition and we can't easily pass in the QDBusInterface there so I promoted the managerIface to a member variable that could then be used.
Revision 2 (+51 -11)
Looks good to me.
Do you have commit access?
I used the QScopedPointer, really nice feature! I also corrected the if (!m_login1Interface.. Thanks!
Revision 3 (+47 -11)