[gnome-settings-daemon] power: signal a backlight change after initializing the rrscreen



commit 590fe67da95a5a5396247916cf7a214640f90aba
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat May 3 19:24:25 2014 +0200

    power: signal a backlight change after initializing the rrscreen
    
    Similar to what we do for the kbd backlight, send a fake backlight
    changed event, to avoid the case when we get a dbus call from
    gnome-shell before we initialized, causing the slider in the menu
    to be 0 until the next change.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729500

 plugins/power/gsd-power-manager.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index d4c15be..79cb58c 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2327,6 +2327,15 @@ on_rr_screen_acquired (GObject      *object,
         /* don't blank inside a VM */
         manager->priv->is_virtual_machine = gsd_power_is_hardware_a_vm ();
 
+        /* queue a signal in case the proxy from gnome-shell was created before we got here
+           (likely, considering that to get here we need a reply from gnome-shell)
+        */
+        if (manager->priv->backlight_available)
+                backlight_iface_emit_changed (manager, GSD_POWER_DBUS_INTERFACE_SCREEN,
+                                              backlight_get_percentage (manager->priv->rr_screen, NULL));
+        else
+                backlight_iface_emit_changed (manager, GSD_POWER_DBUS_INTERFACE_SCREEN, -1);
+
         gnome_settings_profile_end (NULL);
 }
 


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