Comment 2 for bug 151648

Revision history for this message
Stijn Vansummeren (stijn.vansummeren) wrote :

I have the same problem on my Dell XPS M1210 laptop running KUbuntu 7.10 Gutsy Gibbon.

* Summary:
The first time the lid is closed the laptop goes into sleep perfectly, after that I need to restart the power manager.

* Analysis of the problem:

I added some print statements to both guidance-power-manager.py and powermanage.py in /usr/share/python-support/kde-guidance-powermanager/
These print statements show that after resuming from the first sleep, the call
  self.powermanager.getLidClosedState()
in line 723 of guidance-power-manager.py trigger a KeyError exception in getLidClosedState() of powermanage.py.

I suspect that the problem lies in the following section of /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux:

#Refresh devices as a resume can do funny things
for type in button battery ac_adapter
do
        devices=`hal-find-by-capability --capability $type`
        for device in $devices
        do
                dbus-send --system --print-reply --dest=org.freedesktop.Hal \
                          $device org.freedesktop.Hal.Device.Rescan
        done
done

Could it be that after the rescan the lidObject of powermanage.py becomes invalid?