[gnome-settings-daemon] power: Only emit screen brightness changed if the callout succeeded
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Only emit screen brightness changed if the callout succeeded
- Date: Mon, 3 Sep 2012 10:12:23 +0000 (UTC)
commit ca0d899f863659120f7b3737fc9384ec3ca4172b
Author: Richard Hughes <richard hughsie com>
Date: Mon Sep 3 11:09:23 2012 +0100
power: Only emit screen brightness changed if the callout succeeded
Fixes one half of https://bugzilla.gnome.org/show_bug.cgi?id=674434
plugins/power/gsd-power-manager.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 033ab8a..6c00823 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2671,7 +2671,7 @@ backlight_set_percentage (GsdPowerManager *manager,
discrete,
error);
out:
- if (emit_changed)
+ if (ret && emit_changed)
backlight_emit_changed (manager);
return ret;
}
@@ -2680,7 +2680,7 @@ static gint
backlight_step_up (GsdPowerManager *manager, GError **error)
{
GnomeRROutput *output;
- gboolean ret;
+ gboolean ret = FALSE;
gint percentage_value = -1;
gint min = 0;
gint max;
@@ -2722,7 +2722,8 @@ backlight_step_up (GsdPowerManager *manager, GError **error)
if (ret)
percentage_value = ABS_TO_PERCENTAGE (min, max, discrete);
out:
- backlight_emit_changed (manager);
+ if (ret)
+ backlight_emit_changed (manager);
return percentage_value;
}
@@ -2730,7 +2731,7 @@ static gint
backlight_step_down (GsdPowerManager *manager, GError **error)
{
GnomeRROutput *output;
- gboolean ret;
+ gboolean ret = FALSE;
gint percentage_value = -1;
gint min = 0;
gint max;
@@ -2772,7 +2773,8 @@ backlight_step_down (GsdPowerManager *manager, GError **error)
if (ret)
percentage_value = ABS_TO_PERCENTAGE (min, max, discrete);
out:
- backlight_emit_changed (manager);
+ if (ret)
+ backlight_emit_changed (manager);
return percentage_value;
}
@@ -2799,7 +2801,7 @@ backlight_set_abs (GsdPowerManager *manager,
value,
error);
out:
- if (emit_changed)
+ if (ret && emit_changed)
backlight_emit_changed (manager);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]