File gnome-settings-daemon-more-power-button-actions.patch of Package gnome-settings-daemon.11222

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(+)

Index: gnome-settings-daemon-3.26.0/data/gsd-enums.h
===================================================================
--- gnome-settings-daemon-3.26.0.orig/data/gsd-enums.h	2017-09-14 14:20:52.202275466 +0200
+++ gnome-settings-daemon-3.26.0/data/gsd-enums.h	2017-09-14 14:21:26.602338266 +0200
@@ -105,6 +105,7 @@
 typedef enum
 {
   GSD_POWER_BUTTON_ACTION_NOTHING,
+  GSD_POWER_BUTTON_ACTION_SHUTDOWN,
   GSD_POWER_BUTTON_ACTION_SUSPEND,
   GSD_POWER_BUTTON_ACTION_HIBERNATE,
   GSD_POWER_BUTTON_ACTION_INTERACTIVE
Index: gnome-settings-daemon-3.26.0/plugins/media-keys/gsd-media-keys-manager.c
===================================================================
--- gnome-settings-daemon-3.26.0.orig/plugins/media-keys/gsd-media-keys-manager.c	2017-09-14 14:20:52.202275466 +0200
+++ gnome-settings-daemon-3.26.0/plugins/media-keys/gsd-media-keys-manager.c	2017-09-14 14:26:14.074784955 +0200
@@ -1953,6 +1953,9 @@
 
         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;
openSUSE Build Service is sponsored by