GNOME Bugzilla – Bug 752836
Add support for ConsoleKit2 inhibit
Last modified: 2015-08-07 09:48:03 UTC
Created attachment 308091 [details] [review] Add support for ConsoleKit2 inhibit ConsoleKit2 has added the same suspend/resume DBUS API that Systemd uses. This patch adds the code to use ConsoleKit2's inhibit API. http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit
Looks good to me, but I did not test it. I pushed your patch to upstream branch th/ConsoleKit2-inhibit-bgo752836, with two fixup commits. http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=th%2FConsoleKit2-inhibit-bgo752836 One is just whitespace cleanup, the other is a suggestion to move the #if.
Built the branch and it works. Let me know if there's more I can do. Here's the output from ListInhibitors. 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.40 reply_serial=2 array [ struct { string "suspend" string "NetworkManager" string "NetworkManager needs to turn off networks" string "delay" uint32 0 uint32 3470 } struct { string "handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch" string "xfce4-power-manager" string "xfce4-power-manager handles these events" string "block" uint32 1000 uint32 3829 } ]
LGTM (didn't test, though).
Patch merged to master: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=0db81e10145a55e0e17af28baeba91e5167aac12 Thank you, Eric.