From 9d10cbee89ca7f82d29b9cb27bef11e23e3803ba Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 6 Mar 2015 14:37:09 +0100 Subject: login: make hold-off timeout configurable This introduces 'HoldoffTimeoutSec' to logind.conf to make IGNORE_LID_SWITCH_{SUSPEND,STARTUP}_USEC configurable. Background: If an external monitor is connected, or if the system is docked, we want to ignore LID events. This is required to support setups where a laptop is used with external peripherals while the LID is closed. However, this requires us to probe all hot-plugged devices before reacting to LID events. But with modern buses like USB, the standards do not impose any timeout on the slots, so we have no chance to know whether a given slot is used or not. Hence, after resume and startup, we have to wait a fixed timeout to give the kernel a chance to probe devices. Our timeout has always been generous enough to support even the slowest devices. However, a lot of people didn't use these features and wanted to disable the hold-off timer. Now we provide a knob to do that. --- src/login/logind.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/login/logind.h') diff --git a/src/login/logind.h b/src/login/logind.h index 48e647ae82..4781688f0a 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -37,9 +37,6 @@ typedef struct Manager Manager; #include "logind-button.h" #include "logind-action.h" -#define IGNORE_LID_SWITCH_STARTUP_USEC (3 * USEC_PER_MINUTE) -#define IGNORE_LID_SWITCH_SUSPEND_USEC (30 * USEC_PER_SEC) - struct Manager { sd_event *event; sd_bus *bus; @@ -120,6 +117,7 @@ struct Manager { Hashmap *polkit_registry; + usec_t holdoff_timeout_usec; sd_event_source *lid_switch_ignore_event_source; size_t runtime_dir_size; -- cgit v1.2.3-54-g00ecf