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 332150 - Gnome power manager tells us we are about to shutdown when critical, and locks gui
Gnome power manager tells us we are about to shutdown when critical, and lock...
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-02-22 09:49 UTC by Richard Hughes
Modified: 2006-02-23 10:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example patch (2.50 KB, patch)
2006-02-22 09:50 UTC, Richard Hughes
none Details | Review

Description Richard Hughes 2006-02-22 09:49:23 UTC
We should display the policy action we are about to do, rather than just "shutdown". We also lock the GUI, when we should do this with a g_timeout that allows the GUI to continue working.
Comment 1 Richard Hughes 2006-02-22 09:50:45 UTC
Created attachment 59919 [details] [review]
example patch

How about something like this?
Comment 2 Jaap A. Haitsma 2006-02-22 19:41:53 UTC
Seems OK to me
Comment 3 Richard Hughes 2006-02-23 00:36:20 UTC
Thanks for the review Jaap.

2006-02-23  Richard Hughes  <richard@hughsie.com>
 src/gpm-manager.c (manager_critical_action_do): Do the critical action as part of a g_timeout, rather than a just a delay so we don't lock the GUI. Fixes #332150
 src/gpm-manager.c (battery_status_changed_primary): Describe what we are going to do better, so we don't say we are going to shutdown when we just are going to hibernate. Fixes https://launchpad.net/malone/bugs/32250
Comment 4 William Jon McCann 2006-02-23 01:06:49 UTC
Hey guys, I'm sorry to always be so late with reviews...

Just one problem with the patch.  In this context, you always need to use the return value of g_timeout_add and remove the GSource by id when finalizing or entering action_do again.  Look in gpm-idle.c or gpm-dpms-x11.c for examples.
Comment 5 Richard Hughes 2006-02-23 10:14:29 UTC
Ahh, Jon. Is there an easy way to do this without a fully blown state machine? What's the worst case scenario if we don't remove GSource? Thanks.