[systemd-devel] Lid close event delivered delayed

Lennart Poettering lennart at poettering.net
Wed Apr 17 07:42:07 PDT 2013


On Wed, 17.04.13 06:58, Jan Engelhardt (jengelh at inai.de) wrote:

> Hi,
> 
> 
> something I observed with systemd-195 is that the LidClose event is 
> delivered when switching from X to console while the lid is closed. This 
> is unexpected, and what I expected is instead that nothing occurs.
> Approximate steps to reproduce, IIRC:
> 1. Plug in external monitor
> 2. Boot machine. By way of KMS, output will be cloned to the big screen.
> 3. When the X desktop is finally running, close laptop lid.
>    (Because the picture is also cloned in this case)
>    In XFCE's power settings, I have set that LidClose does not 
>    do anything - for obvious reason.
> <let any amount of time pass>
> 4. Switch to tty1
> 5. systemd does an S2RAM.

Well, the current logic is that we suspend when the lid is closed, and
no lid switch inhibitor lock is taken. Lid switch inhibitor locks are
currently per-VT, i.e. a lock taken by GNOME is considered irrelevant if
you switch away from GNOME. Which so far sounded like the right thing to
do, since GNOME wouldn't get any kbd events anymore if it's not in the
fg, so couldn't hande the event anyway, and as soon as you have multiple
sessions running at the same time they'd even start fighting for it. So
in order to make sure the lid switch suspend works fine even when you
happen to switch away from GNOME logind will handle it then.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list