[Xfce4-commits] [xfce/xfce4-power-manager] 12/17: Setup brightness switch on startup

noreply at xfce.org noreply at xfce.org
Wed Jul 23 22:03:02 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 70d8bbc6a7581a6449fdaba5074326b40b5b6b2c
Author: Harald Judt <h.judt at gmx.at>
Date:   Wed Jul 23 12:56:11 2014 +0200

    Setup brightness switch on startup
---
 src/xfpm-backlight.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/xfpm-backlight.c b/src/xfpm-backlight.c
index c49013b..dcaabd0 100644
--- a/src/xfpm-backlight.c
+++ b/src/xfpm-backlight.c
@@ -357,12 +357,29 @@ xfpm_backlight_init (XfpmBacklight *backlight)
     }
     else
     {
+	gboolean ret;
+
 	backlight->priv->idle   = egg_idletime_new ();
 	backlight->priv->conf   = xfpm_xfconf_new ();
 	backlight->priv->button = xfpm_button_new ();
 	backlight->priv->power    = xfpm_power_get ();
 	backlight->priv->notify = xfpm_notify_new ();
 	backlight->priv->max_level = xfpm_brightness_get_max_level (backlight->priv->brightness);
+	backlight->priv->brightness_switch = -1;
+
+	xfconf_g_property_bind (xfpm_xfconf_get_channel(backlight->priv->conf),
+							PROPERTIES_PREFIX BRIGHTNESS_SWITCH, G_TYPE_INT,
+							G_OBJECT(backlight), BRIGHTNESS_SWITCH);
+
+	ret = xfpm_brightness_get_switch (backlight->priv->brightness,
+									  &backlight->priv->brightness_switch);
+
+	if (ret)
+	g_object_set (G_OBJECT (backlight),
+				  BRIGHTNESS_SWITCH,
+				  backlight->priv->brightness_switch,
+				  NULL);
+	backlight->priv->brightness_switch_initialized = TRUE;
 
 	g_signal_connect (backlight->priv->idle, "alarm-expired",
                           G_CALLBACK (xfpm_backlight_alarm_timeout_cb), backlight);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list