GNOME Bugzilla – Bug 329512
g-p-m should not suspend if lid is closed while currently plugged in
Last modified: 2006-02-18 09:30:15 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).
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?
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?
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.
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.
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?
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.
Okay, all valid points. Could you knock a quick patch up for me please Jaap?
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.
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
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)
(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.