[gnome-settings-daemon/gnome-3-12] power: Emit change notification for brightness



commit a7d753e16d60b7fc793090e7532a837be315b1e6
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Apr 22 19:21:04 2014 -0400

    power: Emit change notification for brightness
    
    This is not happening automatically, and without it, the gnome-shell
    and the gnome-control-center sliders don't react to each others
    changes. This may also fix the problem where brightness sliders are
    stuck at zero after login.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727048

 plugins/power/gsd-power-manager.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index e7924b8..847e382 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2694,13 +2694,26 @@ handle_set_property_other (GsdPowerManager *manager,
 
         if (g_strcmp0 (interface_name, GSD_POWER_DBUS_INTERFACE_SCREEN) == 0) {
                 g_variant_get (value, "i", &brightness_value);
-                return backlight_set_percentage (manager->priv->rr_screen,
-                                                 brightness_value, error);
+                if (backlight_set_percentage (manager->priv->rr_screen, brightness_value, error)) {
+                        backlight_iface_emit_changed (manager, GSD_POWER_DBUS_INTERFACE_SCREEN, 
brightness_value);
+                        return TRUE;
+                } else {
+                        g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+                                     "Setting %s.%s failed", interface_name, property_name);
+                        return FALSE;
+                }
         } else if (g_strcmp0 (interface_name, GSD_POWER_DBUS_INTERFACE_KEYBOARD) == 0) {
                 g_variant_get (value, "i", &brightness_value);
                 brightness_value = PERCENTAGE_TO_ABS (0, manager->priv->kbd_brightness_max,
                                                       brightness_value);
-                return upower_kbd_set_brightness (manager, brightness_value, error);
+                if (upower_kbd_set_brightness (manager, brightness_value, error)) {
+                        backlight_iface_emit_changed (manager, GSD_POWER_DBUS_INTERFACE_KEYBOARD, 
brightness_value);
+                        return TRUE;
+                } else {
+                        g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+                                     "Setting %s.%s failed", interface_name, property_name);
+                        return FALSE;
+                }
         }
 
         g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]