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 329512 - g-p-m should not suspend if lid is closed while currently plugged in
g-p-m should not suspend if lid is closed while currently plugged in
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.13.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-02-01 20:24 UTC by Christopher Aillon
Modified: 2006-02-18 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christopher Aillon 2006-02-01 20:24:28 UTC
Version 2.13.5-2 in rawhide:

I have a docking station for my laptop, which provides power, monitor, keybord, mouse, and speakers etc.

When I close the lid while its shut, my system goes into suspend.  This is sort of broken.  If the user is plugged in, there is no immediate need to conserve power.  As soon as the laptop is unplugged while the lid is closed, we should immediately suspend (provided the user has the appropriate pref set, and no I don't think we should add yet another pref, this seems to be common sense where g-p-m can be smart).
Comment 1 Richard Hughes 2006-02-03 23:43:54 UTC
How can g-p-m use HAL to detect if the computer is on a docking station?
Is there additional hardware present, or a change in the dmi data that we can detect?
Comment 2 Richard Hughes 2006-02-04 00:06:19 UTC
I think davidz mentioned an acpi event for a dock -- or perhaps an /proc/acpi/foo key that could be polled in the acpi addon.
Can you grab something similar to "for i in /proc/acpi/*/*/*; do echo $i; cat $i; done" so all the keys are shown?
Comment 3 Christopher Aillon 2006-02-04 21:18:20 UTC
For my T41, you want /proc/acpi/ibm/dock
status:         undocked

but, I'm sure my Dell notebook doesn't have that same key (i imagine it would be different per laptop).  Regardless, though, I really think it shouldn't suspend if its plugged in *preiod*.  I also use my laptop at home and plug it into my 42" TV for a few hours when watching movies from it and use bluetooth keyboard/mouse to control it, etc. and sometimes i plug it into a projector, other times i simply use a fake dock (I only have one at work, not at home).  I have an extra monitor cable, keyboard and mouse to stick into it manually.

All of these times, I close the lid and I am not docked during any of them.
Comment 4 Christopher Aillon 2006-02-04 21:22:18 UTC
Additionally, the benefit of not suspending while plugged in is that you can "resume" much quicker.  The user gets a more pleasant experience since their computer is ready faster.  We can do this well since we don't need to conserve power.  But again, as soon as we're unplugged, go into suspend.
Comment 5 Richard Hughes 2006-02-05 15:34:43 UTC
Hmm, this is a setting that would probably prompt a bugzilla the other way ("g-p-m doesn't suspend when I shut the lid when on ac power") so I don't think we can just add the case unconditionally.
Jaap, Jon, what are your views?
Comment 6 Jaap A. Haitsma 2006-02-05 15:47:36 UTC
I like the idea of not suspending when you shut the lid when AC is plugged in. Becasue of all the advantages Christoper is mentioning:
1) works with docking station
2) works while you play a movie on the TV from your computer
3) "very fast resume" when you open the lid

The bug report ("g-p-m doesn't suspend when I shut the lid when on ac power") can occur, but then a valid question is why would you want it to suspend if you are on ac power when you close the lid? I don't see a reason. If I won't to suspend I can always choose it explicitly from the menu.
So in my opinion that bug is just a WONTFIX.

Furthermore the bug report is now likely to be triggerd because in the capplet we specify that we want to do when we close the lid. IMHO we should remove that setting in the future when hibernating and suspending start to work well on most laptops and then just choose a good default behavior. So then the probability of a bug report should even be lower.


Comment 7 Richard Hughes 2006-02-05 16:32:17 UTC
Okay, all valid points. Could you knock a quick patch up for me please Jaap?
Comment 8 Christopher Aillon 2006-02-05 20:04:10 UTC
Well, the reason you'd want it to suspend on AC power is to get a faster charge.  But that is an edge case, since most of the time people won't care; and if you are that desparate for charge, hibernate/shutdown will work better.  It is a rare case and the user can take steps needed to conserve energy manually via menus.
Comment 9 Richard Hughes 2006-02-06 00:06:30 UTC
Agreed. I've committed a patch to fix this to CVS:

2006-02-06  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (lid_button_pressed): Only do lid sleep action
	when on battery power. Fixes bug #329512
Comment 10 Corey Burger 2006-02-17 22:27:05 UTC
I disagree with this. There is no harm is suspending when the lid is closed when on AC power, as long as resume is fast enough. 

In addition, what if I close the lid while on my docking station and then remove it, without opening the machine? (This may be considered a seperate bug report)
Comment 11 Christopher Aillon 2006-02-18 09:30:15 UTC
(In reply to comment #10)
> I disagree with this. There is no harm is suspending when the lid is closed
> when on AC power, as long as resume is fast enough. 

I gave reasons already.  See comment 3/comment 6.


> In addition, what if I close the lid while on my docking station and then
> remove it, without opening the machine? (This may be considered a seperate bug
> report)

We should immediately suspend.  See comment 0 and comment 4.