[systemd-devel] improve lid switch event handling
Lennart Poettering
lennart at poettering.net
Wed Jul 23 02:26:35 PDT 2014
On Tue, 22.07.14 12:35, Thomas Blume (Thomas.Blume at suse.com) wrote:
> If so, we could record a previous lid open event e.g. in a status file.
> We could then inhibit the suspend if there was no previous lid open event or
> allow it without timeout, if there was one.
Not following here... Note that the lid switch is actually an input
"switch" exposed by the kernel, not a "key". This means that it is a
binary thing anyway, and lid switch close events are never generated
when the device is already closed...
I am also pretty sure we should always react to lid switch state. Many
laptops have a power button accessible even if the device is closed (in
particular all "convertible" devices, such as the Lenovo Yoga I
have). Devices like that are prone to "accidental" resumes in backpacks
and such (because something presses on the power button), and we want
them to go back to suspend again, so that they don't stay on forever in
the backpack.
It's really annoying that we have to employ a timeout though before
going back to suspend. This is required because there's no point in time
when USB devices have to have shown up, and we want to allow USB docking
stations with VGA to block the suspend...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list