gnome-power-manager r2824 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r2824 - in trunk: . src
- Date: Mon, 23 Jun 2008 10:03:01 +0000 (UTC)
Author: rhughes
Date: Mon Jun 23 10:03:00 2008
New Revision: 2824
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2824&view=rev
Log:
2008-06-23 TomaÅ Åolc <tomaz solc tablix org>
* src/gpm-brightness-hal.c: (gpm_brightness_hal_up),
(gpm_brightness_hal_down), (gpm_brightness_hal_init):
Added support for the 'brightness_in_hardware' hal property.
Modified:
trunk/ChangeLog
trunk/src/gpm-brightness-hal.c
Modified: trunk/src/gpm-brightness-hal.c
==============================================================================
--- trunk/src/gpm-brightness-hal.c (original)
+++ trunk/src/gpm-brightness-hal.c Mon Jun 23 10:03:00 2008
@@ -58,6 +58,10 @@
gchar *udi;
gboolean hw_changed;
DbusProxy *gproxy;
+
+ /* true if hardware automatically sets brightness in response to
+ * key press events */
+ gboolean does_own_updates;
};
enum {
@@ -315,7 +319,8 @@
gpm_brightness_hal_get_hw (brightness, ¤t_hw);
/* the panel has been updated in firmware */
- if (current_hw != brightness->priv->last_set_hw) {
+ if (current_hw != brightness->priv->last_set_hw ||
+ brightness->priv->does_own_updates) {
brightness->priv->last_set_hw = current_hw;
} else {
/* macbook pro has a bazzillion brightness levels, be a bit clever */
@@ -357,7 +362,8 @@
gpm_brightness_hal_get_hw (brightness, ¤t_hw);
/* the panel has been updated in firmware */
- if (current_hw != brightness->priv->last_set_hw) {
+ if (current_hw != brightness->priv->last_set_hw ||
+ brightness->priv->does_own_updates) {
gpm_brightness_hal_get_hw (brightness, &brightness->priv->last_set_hw);
} else {
/* macbook pro has a bazzillion brightness levels, be a bit clever */
@@ -438,6 +444,7 @@
gchar **names;
HalGManager *manager;
HalGDevice *device;
+ gboolean res;
brightness->priv = GPM_BRIGHTNESS_HAL_GET_PRIVATE (brightness);
brightness->priv->gproxy = NULL;
@@ -466,6 +473,24 @@
if (brightness->priv->levels == 0 || brightness->priv->levels > 256) {
gpm_warning ("Laptop panel levels are invalid!");
}
+
+ /* Check if hardware handles brightness changes automatically */
+ res = hal_gdevice_get_bool (device,
+ "laptop_panel.brightness_in_hardware",
+ &brightness->priv->does_own_updates, NULL);
+
+ if (!res) {
+ brightness->priv->does_own_updates = FALSE;
+ gpm_debug ("laptop_panel.brightness_in_hardware not found. "
+ "Assuming false");
+ } else {
+ if (brightness->priv->does_own_updates) {
+ gpm_debug ("laptop_panel.brightness_in_hardware: True");
+ } else {
+ gpm_debug ("laptop_panel.brightness_in_hardware: False");
+ }
+ }
+
g_object_unref (device);
/* get a managed proxy */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]