[gnome-power-manager] Remove the DPMS mode selection. All free drivers do the right thing now



commit 88d2df57cb663d60e9e3714d808e5e36fa55d7aa
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 18 22:41:45 2010 +0000

    Remove the DPMS mode selection. All free drivers do the right thing now

 data/org.gnome.power-manager.gschema.migrate |    2 --
 data/org.gnome.power-manager.gschema.xml     |   15 ---------------
 src/gpm-backlight.c                          |   19 +------------------
 src/gpm-common.h                             |    2 --
 4 files changed, 1 insertions(+), 37 deletions(-)
---
diff --git a/data/org.gnome.power-manager.gschema.migrate b/data/org.gnome.power-manager.gschema.migrate
index aad17ed..d767fe5 100644
--- a/data/org.gnome.power-manager.gschema.migrate
+++ b/data/org.gnome.power-manager.gschema.migrate
@@ -2,8 +2,6 @@
 backlight-enable = /apps/gnome-power-manager/backlight/enable
 backlight-battery-reduce = /apps/gnome-power-manager/backlight/battery_reduce
 brightness-dim-battery = /apps/gnome-power-manager/backlight/brightness_dim_battery
-dpms-method-ac = /apps/gnome-power-manager/backlight/dpms_method_ac
-dpms-method-battery = /apps/gnome-power-manager/backlight/dpms_method_battery
 brightness-ac" = /apps/gnome-power-manager/backlight/brightness_ac
 button-suspend = /apps/gnome-power-manager/buttons/suspend
 button-hibernate = /apps/gnome-power-manager/buttons/hibernate
diff --git a/data/org.gnome.power-manager.gschema.xml b/data/org.gnome.power-manager.gschema.xml
index 8dd9502..b53aa2c 100644
--- a/data/org.gnome.power-manager.gschema.xml
+++ b/data/org.gnome.power-manager.gschema.xml
@@ -6,11 +6,6 @@
     <value nick="critical" value="3"/>
     <value nick="never" value="4"/>
   </enum>
-  <enum id="org.gnome.power-manager.DpmsMethod">
-    <value nick="standby" value="1"/>
-    <value nick="suspend" value="2"/>
-    <value nick="off" value="3"/>
-  </enum>
   <schema id="org.gnome.power-manager" path="/apps/gnome-power-manager/">
     <key name="backlight-enable" type="b">
       <default>true</default>
@@ -27,16 +22,6 @@
       <summary>LCD dimming amount when on battery</summary>
       <description>The amount to dim the brightness of the display when on battery power. Possible values are between 0 and 100.</description>
     </key>
-    <key name="dpms-method-ac" enum="org.gnome.power-manager.DpmsMethod">
-      <default>'off'</default>
-      <summary>Method used to blank screen on AC</summary>
-      <description>The DPMS method used to blank the screen when on AC power.</description>
-    </key>
-    <key name="dpms-method-battery" enum="org.gnome.power-manager.DpmsMethod">
-      <default>'off'</default>
-      <summary>Method used to blank screen on battery</summary>
-      <description>The DPMS method used to blank the screen when on battery power.</description>
-    </key>
     <key name="brightness-ac" type="d">
       <default>1.0</default>
       <summary>LCD brightness when on AC</summary>
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c
index 6beefe6..d0a7e01 100644
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -562,8 +562,6 @@ gpm_backlight_idle_changed_cb (GpmIdle *idle, GpmIdleMode mode, GpmBacklight *ba
 	gboolean ret;
 	gboolean is_active;
 	GError *error = NULL;
-	gboolean on_battery;
-	GpmDpmsMode dpms_mode;
 
 	/* don't dim or undim the screen when the lid is closed */
 	if (gpm_button_is_lid_closed (backlight->priv->button))
@@ -611,23 +609,8 @@ gpm_backlight_idle_changed_cb (GpmIdle *idle, GpmIdleMode mode, GpmBacklight *ba
 		gpm_backlight_notify_system_idle_changed (backlight, TRUE);
 		gpm_backlight_brightness_evaluate_and_set (backlight, FALSE);
 
-		/* get the DPMS state we're supposed to use on the power state */
-		g_object_get (backlight->priv->client,
-			      "on-battery", &on_battery,
-			      NULL);
-		if (!on_battery)
-			dpms_mode = g_settings_get_enum (backlight->priv->settings, GPM_SETTINGS_DPMS_METHOD_AC);
-		else
-			dpms_mode = g_settings_get_enum (backlight->priv->settings, GPM_SETTINGS_DPMS_METHOD_BATT);
-
-		/* check if method is valid */
-		if (dpms_mode == GPM_DPMS_MODE_UNKNOWN || dpms_mode == GPM_DPMS_MODE_ON) {
-			g_warning ("BACKLIGHT method %s unknown. Using OFF.", gpm_dpms_mode_to_string (dpms_mode));
-			dpms_mode = GPM_DPMS_MODE_OFF;
-		}
-
 		/* turn backlight off */
-		ret = gpm_dpms_set_mode (backlight->priv->dpms, dpms_mode, &error);
+		ret = gpm_dpms_set_mode (backlight->priv->dpms, GPM_DPMS_MODE_OFF, &error);
 		if (!ret) {
 			g_warning ("failed to change DPMS: %s", error->message);
 			g_error_free (error);
diff --git a/src/gpm-common.h b/src/gpm-common.h
index cce6be0..3f1b765 100644
--- a/src/gpm-common.h
+++ b/src/gpm-common.h
@@ -48,8 +48,6 @@ G_BEGIN_DECLS
 /* backlight stuff */
 #define GPM_SETTINGS_BACKLIGHT_ENABLE			"backlight-enable"
 #define GPM_SETTINGS_BACKLIGHT_BATTERY_REDUCE		"backlight-battery-reduce"
-#define GPM_SETTINGS_DPMS_METHOD_AC			"dpms-method-ac"
-#define GPM_SETTINGS_DPMS_METHOD_BATT			"dpms-method-battery"
 #define GSD_SETTINGS_IDLE_BRIGHTNESS			"idle-brightness"
 #define GSD_SETTINGS_IDLE_DIM_AC			"idle-dim-ac"
 #define GSD_SETTINGS_IDLE_DIM_BATT			"idle-dim-battery"



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