ConsoleKit2 support for screenlocker
Review Request #124469 - Created July 26, 2015 and submitted
ConsoleKit2 has the same API as systemd-logind for Lock, Unlock,
PrepareForSleep, and Inhibit. This patch adds the functionality
for ConsoleKit2 while attempting to minimize code duplication.
dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.ListInhibitors
method return sender=:1.1 -> dest=:1.80 reply_serial=2
string "NetworkManager needs to turn off networks"
string "KDE handles power events"
string "Screen Locker"
string "Ensuring that the screen gets locked before going to sleep"
Verified ConsoleKit2 does delay suspending until both delay locks are removed.
Can consolekit actually close and restart whilst a session is open?
Is it ever possible to see both logind and consolekit? If so our connected=true/false can get potentially broken.
our normal naming is m_lowerCamelCase
also, can you set these to 0.
const QString *m_service = 0;
I know you set these before use but it makes debugging a backtrace easier if they do ever get used early somewhere in the future
we should check m_connected here
otherwise there's a code path where we have neither logind or console kit, m_service is invalid and we crash
(ksldapp.cpp:280 doesn't check and will call inhibit regardless of connection state)
Thanks for the reviews!
Removed the service watcher for CK. Also have it give preference to logind.
Changed the case of the variables to match the standard and set the pointers to nullptr initially.
Added a check in inhibit to see if we're connected to a service.
Revision 2 (+67 -13)