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 607748 - gpm_manager_is_inhibit_valid is a stub
gpm_manager_is_inhibit_valid is a stub
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: Chris Coulson
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-01-22 10:52 UTC by Severin Heiniger
Modified: 2010-01-27 21:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Don-t-automatically-suspend-if-there-are-suspend-inh.patch (11.22 KB, patch)
2010-01-26 23:43 UTC, Chris Coulson
accepted-commit_now Details | Review

Description Severin Heiniger 2010-01-22 10:52:20 UTC
While porting a LottaNZB plug-in from the old org.freedesktop.PowerManagement.Inhibit API to the new org.gnome.SessionManager API, I noticed that after successfully passing the 0x4 flag to the D-Bus method org.gnome.SessionManager.Inhibit, the computer will still be suspended.

After some investigation [1] by Chris Coulson, we noticed that gnome-power-manager doesn't actually check if there are any inhibitors before suspending, rendering the D-Bus method useless. In fact, gpm_manager_is_inhibit_valid just returns TRUE. It should use gpm-session.c to check if there are any inhibitors for that particular action. Implementing this method would also require gpm-session.c to be changed, because the term "inhibited" is limited to the concept of session timeouts there (flag 0x8).

[1] https://bugs.edge.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/510907
Comment 1 Chris Coulson 2010-01-26 23:43:49 UTC
Created attachment 152366 [details] [review]
0001-Don-t-automatically-suspend-if-there-are-suspend-inh.patch

Here is a patch which re-implements this functionality. If it looks ok, then I can commit this.
Comment 2 Richard Hughes 2010-01-27 07:17:50 UTC
Review of attachment 152366 [details] [review]:

Looks good to me, although I'm not sure I see the point of the last_mode as if we're in SLEEP, then we won't catch the state transition and should just go back to NORMAL when we resume. Feel free to correct me :-)

Otherwise, good to apply, thanks.
Comment 3 Chris Coulson 2010-01-27 21:23:32 UTC
Yeah, you're right - I added last_mode just out of paranoia but it probably isn't really needed, so I've removed that part. Anyway, I've committed this now as commit b9a8c88