[gnome-power-manager] Do not handle the power hot-keys, it's now done in gnome-settings-daemon



commit 127af3efb79ebc5bbbc8f91c2c50ef5977031e8c
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jul 4 12:27:03 2011 +0100

    Do not handle the power hot-keys, it's now done in gnome-settings-daemon

 configure.ac      |    5 -----
 src/gpm-button.c  |   13 -------------
 src/gpm-button.h  |    4 ----
 src/gpm-manager.c |   10 +---------
 4 files changed, 1 insertions(+), 31 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 13588e1..5f193ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,11 +129,6 @@ PKG_CHECK_MODULES(UPOWER, upower-glib >= 0.9.1)
 dnl **** Check for NOTIFY ****
 PKG_CHECK_MODULES(NOTIFY, libnotify >= 0.7.0)
 
-PKG_CHECK_EXISTS(
- [xproto >= 7.0.15],
- [AC_DEFINE(HAVE_XF86XK_SUSPEND, 1, [Define if XF86XK_Suspend is available])
-  AC_DEFINE(HAVE_XF86XK_HIBERNATE, 1, [Define if XF86XK_Hibernate is available])])
-
 dnl ---------------------------------------------------------------------------
 dnl - Make paths available for source files
 dnl ---------------------------------------------------------------------------
diff --git a/src/gpm-button.c b/src/gpm-button.c
index baf817a..5345160 100644
--- a/src/gpm-button.c
+++ b/src/gpm-button.c
@@ -317,19 +317,6 @@ gpm_button_init (GpmButton *button)
 	g_signal_connect (button->priv->client, "changed",
 			  G_CALLBACK (gpm_button_client_changed_cb), button);
 
-	/* register the brightness keys */
-	gpm_button_xevent_key (button, XF86XK_PowerOff, GPM_BUTTON_POWER);
-#ifdef HAVE_XF86XK_SUSPEND
-	/* The kernel messes up suspend/hibernate in some places. One of
-	 * them is the key names. Unfortunately, they refuse to see the
-	 * errors of their way in the name of 'compatibility'. Meh
-	 */
-	gpm_button_xevent_key (button, XF86XK_Suspend, GPM_BUTTON_HIBERNATE);
-#endif
-	gpm_button_xevent_key (button, XF86XK_Sleep, GPM_BUTTON_SUSPEND); /* should be configurable */
-#ifdef HAVE_XF86XK_HIBERNATE
-	gpm_button_xevent_key (button, XF86XK_Hibernate, GPM_BUTTON_HIBERNATE);
-#endif
 	gpm_button_xevent_key (button, XF86XK_MonBrightnessUp, GPM_BUTTON_BRIGHT_UP);
 	gpm_button_xevent_key (button, XF86XK_MonBrightnessDown, GPM_BUTTON_BRIGHT_DOWN);
 	gpm_button_xevent_key (button, XF86XK_ScreenSaver, GPM_BUTTON_LOCK);
diff --git a/src/gpm-button.h b/src/gpm-button.h
index 891acc8..bf226ac 100644
--- a/src/gpm-button.h
+++ b/src/gpm-button.h
@@ -35,10 +35,6 @@ G_BEGIN_DECLS
 
 typedef struct GpmButtonPrivate GpmButtonPrivate;
 
-#define GPM_BUTTON_POWER		"power"
-#define GPM_BUTTON_SLEEP		"sleep"
-#define GPM_BUTTON_SUSPEND		"suspend"
-#define GPM_BUTTON_HIBERNATE		"hibernate"
 #define GPM_BUTTON_LID_DEP		"lid"		/* Remove when HAL drops input support */
 #define GPM_BUTTON_LID_OPEN		"lid-up"
 #define GPM_BUTTON_LID_CLOSED		"lid-down"
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 15d3206..51d52be 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -986,15 +986,7 @@ gpm_manager_button_pressed_cb (GpmButton *button, const gchar *type, GpmManager
 		return;
 	}
 
-	if (g_strcmp0 (type, GPM_BUTTON_POWER) == 0) {
-		gpm_manager_perform_policy (manager, GSD_SETTINGS_BUTTON_POWER, "The power button has been pressed.");
-	} else if (g_strcmp0 (type, GPM_BUTTON_SLEEP) == 0) {
-		gpm_manager_perform_policy (manager, GSD_SETTINGS_BUTTON_SUSPEND, "The suspend button has been pressed.");
-	} else if (g_strcmp0 (type, GPM_BUTTON_SUSPEND) == 0) {
-		gpm_manager_perform_policy (manager, GSD_SETTINGS_BUTTON_SUSPEND, "The suspend button has been pressed.");
-	} else if (g_strcmp0 (type, GPM_BUTTON_HIBERNATE) == 0) {
-		gpm_manager_perform_policy (manager, GSD_SETTINGS_BUTTON_HIBERNATE, "The hibernate button has been pressed.");
-	} else if (g_strcmp0 (type, GPM_BUTTON_LID_OPEN) == 0) {
+	if (g_strcmp0 (type, GPM_BUTTON_LID_OPEN) == 0) {
 		gpm_manager_lid_button_pressed (manager, FALSE);
 	} else if (g_strcmp0 (type, GPM_BUTTON_LID_CLOSED) == 0) {
 		gpm_manager_lid_button_pressed (manager, TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]