[Xfce4-commits] [xfce/xfce4-power-manager] 11/17: Only run code for setting brightness switch if it has been initialized
noreply at xfce.org
noreply at xfce.org
Wed Jul 23 22:03:01 CEST 2014
This is an automated email from the git hooks/post-receive script.
hjudt pushed a commit to branch master
in repository xfce/xfce4-power-manager.
commit f06a149eaebed9f3fea44c06b18d2eb54a451dde
Author: Harald Judt <h.judt at gmx.at>
Date: Wed Jul 23 12:47:34 2014 +0200
Only run code for setting brightness switch if it has been initialized
---
src/xfpm-backlight.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/xfpm-backlight.c b/src/xfpm-backlight.c
index ce36307..c49013b 100644
--- a/src/xfpm-backlight.c
+++ b/src/xfpm-backlight.c
@@ -83,6 +83,7 @@ struct XfpmBacklightPrivate
gint brightness_switch;
gint brightness_switch_save;
+ gboolean brightness_switch_initialized;
gboolean dimmed;
gboolean block;
@@ -347,6 +348,7 @@ xfpm_backlight_init (XfpmBacklight *backlight)
backlight->priv->power = NULL;
backlight->priv->dimmed = FALSE;
backlight->priv->block = FALSE;
+ backlight->priv->brightness_switch_initialized = FALSE;
if ( !backlight->priv->has_hw )
{
@@ -422,6 +424,8 @@ xfpm_backlight_set_property (GObject *object,
{
case PROP_BRIGHTNESS_SWITCH:
backlight->priv->brightness_switch = g_value_get_int (value);
+ if (!backlight->priv->brightness_switch_initialized)
+ break;
ret = xfpm_brightness_set_switch (backlight->priv->brightness,
backlight->priv->brightness_switch);
if (!ret)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list