summaryrefslogtreecommitdiff
path: root/src/login/logind-action.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/logind-action.c')
-rw-r--r--src/login/logind-action.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/login/logind-action.c b/src/login/logind-action.c
index c04f2107d..da5a8305f 100644
--- a/src/login/logind-action.c
+++ b/src/login/logind-action.c
@@ -72,10 +72,18 @@ int manager_handle_action(
/* If we are docked don't react to lid closing */
if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) {
+ int n;
+
if (manager_is_docked(m)) {
log_debug("Ignoring lid switch request, system is docked.");
return 0;
}
+
+ n = manager_count_displays(m);
+ if (n != 1) {
+ log_debug("Ignoring lid switch request, %s displays connected.");
+ return 0;
+ }
}
/* If the key handling is inhibited, don't do anything */