X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind.c;h=f1b6a86298bd5b1237469c8c6f60292da094172b;hb=d5099efc47d4e6ac60816b5381a5f607ab03f06e;hp=52e1c43a472289be13910c6e824cbc4fa111bca7;hpb=af4ec4309e8f82aad87a8d574785c12f8763d5f8;p=elogind.git diff --git a/src/login/logind.c b/src/login/logind.c index 52e1c43a4..f1b6a8629 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -55,6 +55,7 @@ Manager *manager_new(void) { m->handle_suspend_key = HANDLE_SUSPEND; m->handle_hibernate_key = HANDLE_HIBERNATE; m->handle_lid_switch = HANDLE_SUSPEND; + m->handle_lid_switch_docked = HANDLE_IGNORE; m->lid_switch_ignore_inhibited = true; m->idle_action_usec = 30 * USEC_PER_MINUTE; @@ -63,17 +64,17 @@ Manager *manager_new(void) { m->runtime_dir_size = PAGE_ALIGN((size_t) (physical_memory() / 10)); /* 10% */ - m->devices = hashmap_new(string_hash_func, string_compare_func); - m->seats = hashmap_new(string_hash_func, string_compare_func); - m->sessions = hashmap_new(string_hash_func, string_compare_func); - m->users = hashmap_new(trivial_hash_func, trivial_compare_func); - m->inhibitors = hashmap_new(string_hash_func, string_compare_func); - m->buttons = hashmap_new(string_hash_func, string_compare_func); + m->devices = hashmap_new(&string_hash_ops); + m->seats = hashmap_new(&string_hash_ops); + m->sessions = hashmap_new(&string_hash_ops); + m->users = hashmap_new(NULL); + m->inhibitors = hashmap_new(&string_hash_ops); + m->buttons = hashmap_new(&string_hash_ops); - m->user_units = hashmap_new(string_hash_func, string_compare_func); - m->session_units = hashmap_new(string_hash_func, string_compare_func); + m->user_units = hashmap_new(&string_hash_ops); + m->session_units = hashmap_new(&string_hash_ops); - m->busnames = set_new(string_hash_func, string_compare_func); + m->busnames = set_new(&string_hash_ops); if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->busnames || !m->user_units || !m->session_units) @@ -232,7 +233,8 @@ static int manager_enumerate_buttons(Manager *m) { if (m->handle_power_key == HANDLE_IGNORE && m->handle_suspend_key == HANDLE_IGNORE && m->handle_hibernate_key == HANDLE_IGNORE && - m->handle_lid_switch == HANDLE_IGNORE) + m->handle_lid_switch == HANDLE_IGNORE && + m->handle_lid_switch_docked == HANDLE_IGNORE) return 0; e = udev_enumerate_new(m->udev); @@ -875,7 +877,8 @@ static int manager_connect_udev(Manager *m) { if (m->handle_power_key != HANDLE_IGNORE || m->handle_suspend_key != HANDLE_IGNORE || m->handle_hibernate_key != HANDLE_IGNORE || - m->handle_lid_switch != HANDLE_IGNORE) { + m->handle_lid_switch != HANDLE_IGNORE || + m->handle_lid_switch_docked != HANDLE_IGNORE) { m->udev_button_monitor = udev_monitor_new_from_netlink(m->udev, "udev"); if (!m->udev_button_monitor)