--- gpm-backlight.c 2007-10-03 01:57:11.000000000 -0400 +++ gpm-backlight.c.new 2007-10-03 01:57:07.000000000 -0400 @@ -603,12 +603,29 @@ idle_changed_cb (GpmIdle *idle, GpmBacklight *backlight) { GError *error; + gboolean on_ac; + gboolean enable_action; + + /* get AC status */ + on_ac = gpm_ac_adapter_is_present (backlight->priv->ac_adapter); + + /* get idle dim setting */ + if (on_ac == TRUE) { + gpm_conf_get_bool (backlight->priv->conf, GPM_CONF_BACKLIGHT_IDLE_DIM_AC, &enable_action); + } else { + gpm_conf_get_bool (backlight->priv->conf, GPM_CONF_BACKLIGHT_IDLE_DIM_BATT, &enable_action); + } + + /* don't dim or undim the screen when idle dimming disabled */ + if (enable_action == FALSE) { + return; + } /* don't dim or undim the screen when the lid is closed */ if (gpm_button_is_lid_closed (backlight->priv->button) == TRUE) { return; } - + if (mode == GPM_IDLE_MODE_NORMAL) { /* deactivate display power management */