[Bug 151648] Re: guidance-power-manager needs restarting after resume in order to suspend again

Stijn Vansummeren stijn.vansummeren at gmail.com
Fri Jan 25 11:27:05 UTC 2008


Attached is a fix to this bug.

The problem is that after a resume HAL re-inserts all button objects.
These button objects are not necessarily re-inserted in the same order
that they were in before resuming however. As such, the lid object can
be  "/org/freedesktop/Hal/devices/computer_logicaldev_input_0" before
resume but "/org/freedesktop/Hal/devices/computer_logicaldev_input_2"
after. In short, all references to the lid object in powermanage.py
become invalid after resume.

This can be fixed by changing the function suspend in /usr/share/python-
support/kde-guidance-powermanager/powermanage.py such that it reads:

    def suspend(self):
        """ Run a suspend command, either via HAL or script. """
        if SUSPEND_USE_HAL:
            try:
                self.computerObject.Suspend(3, dbus_interface="org.freedesktop.Hal.Device.SystemPowerManagement")

            except dbus.DBusException, e:
                pass #we get a DBusException: No reply within specified time
            finally:
                #Suspend causes HAL to re-insert all of its button devices (which may end up in a different order).
                #Make sure we have the up-to-date reference
                #We put this call in the finally clause as resume may throw an exception despite resuming OK
                self._initLid()
        else:
            self._sleepMode(S3_COMMAND)

This causes all reference to the lid object to be updated after
resuming.

I am willing to update the corresponding .deb package for inclusion in
KUbuntu if someone is willing to give me some pointers as how to do it
and where to submit it to.

(It is possible that this bug has already been fixed in the current
development version of kde-guidance. I have been unable to find where to
get the development version, however.)

** Attachment added: "fix-lp151648.patch"
   http://launchpadlibrarian.net/11560032/fix-lp151648.patch

-- 
guidance-power-manager needs restarting after resume in order to suspend again
https://bugs.launchpad.net/bugs/151648
You received this bug notification because you are a member of Kubuntu
Team, which is a bug contact for kde-guidance in ubuntu.




More information about the kubuntu-bugs mailing list