summaryrefslogtreecommitdiff
path: root/src/login/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-03 20:49:33 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-03 20:57:09 +0100
commitf9cd6be10ece07e10488c05e270a0b5860779864 (patch)
treef236bd39b54c2b66276c7ac72a36cb565cf0b53e /src/login/logind-dbus.c
parent7e9110a29d90041b0364cb93a84aec9dd72363b6 (diff)
logind: ignore lid switch events for 30s after each suspend and 3min after startup
This is needed to give USB docking stations and suchlike time to settle, so that a display connected to an USB docking station can actually act as a lid swith inhibitor correctly. With this change we should have somewhat reliable docking station support in place.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r--src/login/logind-dbus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index fc8953155d..c9c58f3f82 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1337,6 +1337,9 @@ static int execute_shutdown_or_sleep(
m->action_job = c;
m->action_what = w;
+ /* Make sure the lid switch is ignored for a while */
+ manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + IGNORE_LID_SWITCH_SUSPEND_USEC);
+
return 0;
}