gnome-settings-daemon/gnome-settings-daemon-more-power-button-actions.patch
Dominique Leuenberger ec5fc1cacc Accepting request 428278 from home:zhangxiaofei:branches:GNOME:Factory
- Rebase gnome-settings-daemon-revert-libinput-mandatory.patch
  for version 3.21.90.

- Rename gnome-settings-daemon-shutdown-with-power-button.patch to
  gnome-settings-daemon-more-power-button-actions.patch:
  Also add back the "interactive" power button action for
  consistency with SLES11 behavior (bsc#996342).

OBS-URL: https://build.opensuse.org/request/show/428278
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-settings-daemon?expand=0&rev=258
2016-09-18 19:58:23 +00:00

44 lines
1.7 KiB
Diff

From 3d9c3ecda9c68039c309bfb6bfc93830c4a0e20e Mon Sep 17 00:00:00 2001
From: Felix Zhang <fezhang@suse.com>
Date: Mon, 12 Sep 2016 18:00:07 +0800
Subject: [PATCH] more power button actions
---
data/gsd-enums.h | 2 ++
plugins/media-keys/gsd-media-keys-manager.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/data/gsd-enums.h b/data/gsd-enums.h
index 4a0356a..87fd158 100644
--- a/data/gsd-enums.h
+++ b/data/gsd-enums.h
@@ -113,6 +113,8 @@ typedef enum
typedef enum
{
GSD_POWER_BUTTON_ACTION_NOTHING,
+ GSD_POWER_BUTTON_ACTION_INTERACTIVE,
+ 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..e9611b9 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -1929,6 +1929,12 @@ 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_INTERACTIVE:
+ do_config_power_action (manager, GSD_POWER_ACTION_INTERACTIVE, in_lock_screen);
+ break;
+ 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