chiark / gitweb /
logind: ignore lid switch events for 30s after each suspend and 3min after startup
[elogind.git] / src / login / logind-dbus.c
index fc8953155d56bcc2a41b2f48d62cd3d058e4c530..c9c58f3f823701f35af3311eb61a3c7205d890b7 100644 (file)
@@ -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;
 }