X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind.h;h=904dc20467100157eecee5a550cefa5f711bc910;hb=c784c5ce777f16ee56086a072dc1466639bc9eff;hp=8aa28a322c0160f0bae2797b809eaa5c0b6b62ad;hpb=98a77df5fe8591034c48e5d56d903ee268de37f9;p=elogind.git diff --git a/src/login/logind.h b/src/login/logind.h index 8aa28a322..904dc2046 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -40,6 +40,7 @@ typedef struct Manager Manager; #include "logind-user.h" #include "logind-inhibit.h" #include "logind-button.h" +#include "logind-action.h" struct Manager { DBusConnection *bus; @@ -90,18 +91,36 @@ struct Manager { Hashmap *inhibitor_fds; Hashmap *button_fds; - /* If a shutdown was delayed due to a inhibitor this contains - the unit name we are supposed to start after the delay is - over */ - const char *delayed_unit; - InhibitWhat delayed_what; - usec_t delayed_timestamp; - usec_t inhibit_delay_max; - HandleButton handle_power_key; - HandleButton handle_sleep_key; - HandleButton handle_lid_switch; + /* If an action is currently being executed or is delayed, + * this is != 0 and encodes what is being done */ + InhibitWhat action_what; + + /* If a shutdown/suspend was delayed due to a inhibitor this + contains the unit name we are supposed to start after the + delay is over */ + const char *action_unit; + + /* If a shutdown/suspend is currently executed, then this is + * the job of it */ + char *action_job; + usec_t action_timestamp; + + int idle_action_fd; /* the timer_fd */ + usec_t idle_action_usec; + usec_t idle_action_not_before_usec; + HandleAction idle_action; + + HandleAction handle_power_key; + HandleAction handle_suspend_key; + HandleAction handle_hibernate_key; + HandleAction handle_lid_switch; + + bool power_key_ignore_inhibited; + bool suspend_key_ignore_inhibited; + bool hibernate_key_ignore_inhibited; + bool lid_switch_ignore_inhibited; }; enum { @@ -110,6 +129,7 @@ enum { FD_BUTTON_UDEV, FD_CONSOLE, FD_BUS, + FD_IDLE_ACTION, FD_OTHER_BASE }; @@ -132,6 +152,7 @@ int manager_dispatch_seat_udev(Manager *m); int manager_dispatch_vcsa_udev(Manager *m); int manager_dispatch_button_udev(Manager *m); int manager_dispatch_console(Manager *m); +int manager_dispatch_idle_action(Manager *m); int manager_enumerate_devices(Manager *m); int manager_enumerate_buttons(Manager *m);