chiark / gitweb /
logind: fix printf format
[elogind.git] / src / login / logind-action.c
index c04f2107d1787d6f861c21a2568f383d88b157eb..c9d8bc5413cd4757f0cc22a6a007b1f3eb067086 100644 (file)
@@ -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, %i displays connected.", n);
+                        return 0;
+                }
         }
 
         /* If the key handling is inhibited, don't do anything */