After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752836 - Add support for ConsoleKit2 inhibit
Add support for ConsoleKit2 inhibit
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-07-24 16:49 UTC by Eric Koegel
Modified: 2015-08-07 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for ConsoleKit2 inhibit (4.86 KB, patch)
2015-07-24 16:49 UTC, Eric Koegel
none Details | Review

Description Eric Koegel 2015-07-24 16:49:38 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
Comment 1 Thomas Haller 2015-08-04 12:50:07 UTC
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.
Comment 2 Eric Koegel 2015-08-05 15:44:23 UTC
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
      }
   ]
Comment 3 Beniamino Galvani 2015-08-06 14:52:25 UTC
LGTM (didn't test, though).
Comment 4 Thomas Haller 2015-08-07 09:48:03 UTC
Patch merged to master:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=0db81e10145a55e0e17af28baeba91e5167aac12


Thank you, Eric.