On Mon, February 25, 2008 11:35, Bart Samwel wrote:
> Martins Krikis wrote:
>> Hmm. Some good points there.
>>
>> No, I wasn't running any of those, in fact kpowersave (which turns out
>> to be
>> a tray applet) wasn't even installed and Gnome still isn't. When logging
>> out
>> of X and pressing the button while logged on the VT, nothing happened.
>>
>> Then I logged back on to X, installed this kpowersave and launched.
>> I already had some other KDE battery monitor tray applet running,
>> so this was now a second one. But it did indeed start handling the
>> keypress generated by acpi_fakekey. So the laptop suspends again.
>> (It's a pity the battery charge amount that this applet shows and the
>> number of batteries installed seems to mismatch reality but that's a
>> different bug and story.)
>>
>> So is Debian's acpi-support design for suspend-to-ram such that it
>> _only_
>> works in X and only if the user has installed some particular
>> utilities to grab the
>> generated fakekey? Now I'm really getting interested in how could it
>> have worked
>> with the 2.6.22.5 kernel. And what is the purpose of
>> /etc/acpi/sleep.sh, since it
>> didn't seem to get involved in the suspend-to-ram orchestrated by
>> kpowersave.
>
> The role is to handle the key if nobody else does. Apparently this goes
> wrong in newer kernels. I've heard some things about a recent rewiring
> of certain event chains, we'll simply have to figure out how the wiring
> currently works. Once I get to my own computer I'll try to figure it out!

OK, that took a bit longer than expected. I've checked it out. The
sleep.sh script is called when the ACPI sleep button is pushed, i.e., we
get a "button/sleep" event. Many laptops have such an ACPI button, and for
those laptops, acpi-support's sleep.sh handles the key only if
klaptopdaemon or gnome-power-manager are not running, otherwise it leaves
the work to those daemons. Apparently this type of laptop doesn't have an
ACPI sleep button, so we'll have to do something else. I'll do the
following, which I hope will fix it:

- We check if klaptopdaemon or gnome-power-manager are running.
- If so, we generate the keypress with acpi_fakekey, which will be picked
up by the power daemons.
- If not, we call sleep.sh.

You can expect this fix in the next upload. If it doesn't turn out to work
without klaptopdaemon installed, please reopen the bug after that.

Cheers,
Bart


Reply via email to