summaryrefslogtreecommitdiff
path: root/src/login/logind.h
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.h
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.h')
-rw-r--r--src/login/logind.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/login/logind.h b/src/login/logind.h
index 74d66415ee..4bb8e7b65a 100644
--- a/src/login/logind.h
+++ b/src/login/logind.h
@@ -42,6 +42,9 @@ 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;
@@ -118,6 +121,8 @@ struct Manager {
bool lid_switch_ignore_inhibited;
Hashmap *polkit_registry;
+
+ sd_event_source *lid_switch_ignore_event_source;
};
Manager *manager_new(void);
@@ -178,3 +183,5 @@ const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned lengt
int manager_watch_busname(Manager *manager, const char *name);
void manager_drop_busname(Manager *manager, const char *name);
+
+int manager_set_lid_switch_ignore(Manager *m, usec_t until);