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 566831 - [PATCH] g-p-m doesn't notice new charge if done while hibernated
[PATCH] g-p-m doesn't notice new charge if done while hibernated
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-01-06 21:23 UTC by Michael Terry
Modified: 2009-03-04 15:23 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Proposed patch (784 bytes, patch)
2009-01-06 21:24 UTC, Michael Terry
none Details | Review

Description Michael Terry 2009-01-06 21:23:24 UTC
Here's the sequence of events:
1) Drain battery until g-p-m hibernates for you
2) While laptop is off, plug it in, giving it some juice (maybe for about 5 mins)
3) Unplug laptop
4) Turn it back on
5) Let it drain again, note g-p-m never re-hibernates

Looking at logs, it seems that g-p-m thinks it already warned the user about critical battery level and so never issues the warning or triggers the system action again.

Looking at the code, this seems to be because while g-p-m resets the warning state when it notices the AC being plugged or unplugged, it never notices a new AC level.

I'm attaching a patch that seems to fix it for me.  But it involves doing something (resetting the state for any warning level change) that has previously explicitly not been done (explicitly mentioned via comments).  Why is resetting the state there bad? (i.e. Comments on the patch?)
Comment 1 Michael Terry 2009-01-06 21:24:19 UTC
Created attachment 125884 [details] [review]
Proposed patch
Comment 2 Richard Hughes 2009-03-04 15:23:59 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.