X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind.h;h=e0cb7d02382c61015779adf67891d8978bfcc744;hb=5e07a79e84ab8b045b9df1a2719f14fc84471a1d;hp=74d66415ee6f35e6e323d5a45325247026266789;hpb=6a79c58603ea816a1b4fa1520397b4e138bc1ca0;p=elogind.git diff --git a/src/login/logind.h b/src/login/logind.h index 74d66415e..e0cb7d023 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; @@ -111,13 +114,20 @@ struct Manager { HandleAction handle_suspend_key; HandleAction handle_hibernate_key; HandleAction handle_lid_switch; + HandleAction handle_lid_switch_docked; bool power_key_ignore_inhibited; bool suspend_key_ignore_inhibited; bool hibernate_key_ignore_inhibited; bool lid_switch_ignore_inhibited; + bool remove_ipc; + Hashmap *polkit_registry; + + sd_event_source *lid_switch_ignore_event_source; + + size_t runtime_dir_size; }; Manager *manager_new(void); @@ -150,6 +160,7 @@ int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); bool manager_is_docked(Manager *m); int manager_count_displays(Manager *m); +bool manager_is_docked_or_multiple_displays(Manager *m); extern const sd_bus_vtable manager_vtable[]; @@ -178,3 +189,11 @@ 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); + +int config_parse_tmpfs_size(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret); +int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret); +int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Seat **ret);