[gnome-power-manager/gnome-2-32] Fix #627711 - Don't crash on systems which don't have XBACKLIGHT
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager/gnome-2-32] Fix #627711 - Don't crash on systems which don't have XBACKLIGHT
- Date: Tue, 31 Aug 2010 12:37:18 +0000 (UTC)
commit db7d17c1e49cf6e9cb9bf77b07e05d1ef32492c1
Author: Chris Coulson <chris coulson canonical com>
Date: Mon Aug 23 12:05:59 2010 +0100
Fix #627711 - Don't crash on systems which don't have XBACKLIGHT
src/gpm-brightness.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index cc8233f..ef0aba4 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -519,6 +519,10 @@ gpm_brightness_foreach_screen (GpmBrightness *brightness, GpmXRandROp op)
g_return_val_if_fail (GPM_IS_BRIGHTNESS (brightness), FALSE);
+ /* Return immediately if we can't use XRandR */
+ if (!brightness->priv->has_extension)
+ return FALSE;
+
/* do for each screen */
length = brightness->priv->resources->len;
for (i=0; i<length; i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]