[gnome-settings-daemon] power: Do not attempt to change the brightness of an output that has been disabled
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Do not attempt to change the brightness of an output that has been disabled
- Date: Mon, 3 Sep 2012 10:12:28 +0000 (UTC)
commit 3c84744716963c40a649330d8dee07fd28ad26f6
Author: Richard Hughes <richard hughsie com>
Date: Mon Sep 3 11:10:04 2012 +0100
power: Do not attempt to change the brightness of an output that has been disabled
Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=674434
plugins/power/gsd-power-manager.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 6c00823..64009bb 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2687,11 +2687,21 @@ backlight_step_up (GsdPowerManager *manager, GError **error)
gint now;
gint step;
guint discrete;
+ GnomeRRCrtc *crtc;
/* prefer xbacklight */
output = get_primary_output (manager);
if (output != NULL) {
+ crtc = gnome_rr_output_get_crtc (output);
+ if (crtc == NULL) {
+ g_set_error (error,
+ GSD_POWER_MANAGER_ERROR,
+ GSD_POWER_MANAGER_ERROR_FAILED,
+ "no crtc for %s",
+ gnome_rr_output_get_name (output));
+ goto out;
+ }
min = gnome_rr_output_get_backlight_min (output);
max = gnome_rr_output_get_backlight_max (output);
now = gnome_rr_output_get_backlight (output, error);
@@ -2738,11 +2748,21 @@ backlight_step_down (GsdPowerManager *manager, GError **error)
gint now;
gint step;
guint discrete;
+ GnomeRRCrtc *crtc;
/* prefer xbacklight */
output = get_primary_output (manager);
if (output != NULL) {
+ crtc = gnome_rr_output_get_crtc (output);
+ if (crtc == NULL) {
+ g_set_error (error,
+ GSD_POWER_MANAGER_ERROR,
+ GSD_POWER_MANAGER_ERROR_FAILED,
+ "no crtc for %s",
+ gnome_rr_output_get_name (output));
+ goto out;
+ }
min = gnome_rr_output_get_backlight_min (output);
max = gnome_rr_output_get_backlight_max (output);
now = gnome_rr_output_get_backlight (output, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]