From 8b9b19bc4259b67822ed66f15f6cfac1284ced85 Mon Sep 17 00:00:00 2001 From: Felix Zhang Date: Wed, 7 Sep 2016 20:14:04 +0800 Subject: [PATCH] shutdown with power key --- data/gsd-enums.h | 1 + plugins/media-keys/gsd-media-keys-manager.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/data/gsd-enums.h b/data/gsd-enums.h index 4a0356a..710d58c 100644 --- a/data/gsd-enums.h +++ b/data/gsd-enums.h @@ -113,6 +113,7 @@ typedef enum typedef enum { GSD_POWER_BUTTON_ACTION_NOTHING, + GSD_POWER_BUTTON_ACTION_SHUTDOWN, GSD_POWER_BUTTON_ACTION_SUSPEND, GSD_POWER_BUTTON_ACTION_HIBERNATE } GsdPowerButtonActionType; diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c index d77ed10..6e0514d 100644 --- a/plugins/media-keys/gsd-media-keys-manager.c +++ b/plugins/media-keys/gsd-media-keys-manager.c @@ -1929,6 +1929,9 @@ do_config_power_button_action (GsdMediaKeysManager *manager, action_type = g_settings_get_enum (manager->priv->power_settings, "power-button-action"); switch (action_type) { + case GSD_POWER_BUTTON_ACTION_SHUTDOWN: + do_config_power_action (manager, GSD_POWER_ACTION_SHUTDOWN, in_lock_screen); + break; case GSD_POWER_BUTTON_ACTION_SUSPEND: do_config_power_action (manager, GSD_POWER_ACTION_SUSPEND, in_lock_screen); break; -- 2.6.6