Inhibit suspending (flag 0x4) not working over DBus

Bug #510907 reported by Severin Heiniger on 2010-01-21
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fix Released
gnome-power-manager (Ubuntu)
Chris Coulson

Bug Description

Binary package hint: gnome-session

While porting the "Inhibit suspending" LottaNZB plug-in (written in Python) from the old org.freedesktop.PowerManagement.Inhibit API to the new org.gnome.SessionManager API introduced in Karmic, I noticed that after successfully passing the 0x4 flag to the Inhibit DBus method [1], the computer will still be suspended after the session has timed out and the amount of time stored in /apps/gnome-power-manager/timeout/sleep_computer_ac has passed after that.

First I thought that I didn't properly use the new API, but I noticed that Transmission (that also passes 0x4 to the very same Inhibit method) doesn't actually prevent the computer from being suspended either, which means that it's neither LottaNZB's nor Transmission's fault.

Passing 0x4 | 0x8 to the Inhibit method works as intended, because the 0x8 flag prevents the session from timing out and thus the computer will not be suspended.

However, I'd rather not use 0x4 | 0x8 because an active download operation is not negatively affected by a timed out session, but only by the computer being suspended.

I really hope that someone can confirm this problem and know how to tackle it.


ProblemType: Bug
Architecture: amd64
Date: Thu Jan 21 23:01:43 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100113)
Package: gnome-session 2.28.0-0ubuntu8
PackageArchitecture: all
ProcVersionSignature: Ubuntu 2.6.32-11.15-generic
SourcePackage: gnome-session
Uname: Linux 2.6.32-11-generic x86_64

Severin Heiniger (severinh) wrote :
Chris Coulson (chrisccoulson) wrote :

After having a quick look at this, it actually looks like it's not fully implemented in gnome-power-manager yet (it should be checking if there are any suspend inhibitors before suspending)

affects: gnome-session (Ubuntu) → gnome-power-manager (Ubuntu)
Changed in gnome-power-manager (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Medium
Severin Heiniger (severinh) wrote :

After having a look at gnome-power-manager's source code, I also noticed that gpm_manager_is_inhibit_valid is a stub. Implementing it also requires gpm-session.c to be changed, because the term "inhibited" is limited to the concept of session timeouts there. I tried to implement it but unfortunately, it didn't work.

I guess this bug should be forwarded upstream, unless this has already happened.

Severin Heiniger (severinh) wrote :

Reported upstream.

Chris Coulson (chrisccoulson) wrote :

Thanks for sending upstream

Changed in gnome-power-manager (Ubuntu):
status: New → Triaged
Changed in gnome-power-manager (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → Chris Coulson (chrisccoulson)
status: Triaged → In Progress
Severin Heiniger (severinh) wrote :

Thanks alot for taking care of this, Chris! I'll give the patch a try tomorrow.

Severin Heiniger (severinh) wrote :

I can confirm that the patch works perfectly. Great work! Is there any chance that this change will be uploaded to Ubuntu Karmic as a SRU? The fact that the LottaNZB "Inhibit suspending" plug-in will only work on Ubuntu 9.04 and 10.04 renders it useless for many people at this point of time.

Chris Coulson (chrisccoulson) wrote :

I've committed this patch upstream now

Changed in gnome-power-manager (Ubuntu):
status: In Progress → Fix Committed
Chris Coulson (chrisccoulson) wrote :

Clsoing this, as the changes are in Lucid now

Changed in gnome-power-manager (Ubuntu):
status: Fix Committed → Fix Released
pune_hunt (punehunt) wrote :

Hello Chris, I am using ubuntu 10.04 LTS lucid, I am still facing the problem of inhibit suspend. Inhibit() only works for logout/restart/shutdown but its not working for suspend & hibernate. Please guide us.

Changed in gnome-power-manager (Ubuntu):
status: Fix Released → Opinion
pune_hunt (punehunt) wrote :

I tried with lottaanz plugin for Inhibit suspend but it didn't work
This is how I am passing flags for inhibit()

QDBusReply<quint32> reply1 = "Inhibit", QCoreApplication::applicationName(), quint32( 0 ), "reason", quint32( 1 | 2 | 4 | 8 ) );

Chris Coulson (chrisccoulson) wrote :

Can you please not reopen fixed bugs to ask questions. You should rather open a support request on

Changed in gnome-power-manager (Ubuntu):
status: Opinion → Fix Released
Changed in gnome-power:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.