[gnome-shell] VolumeMenu: read output and input if PulseAudio is already ready when constructing



commit 3f5edf7c3ecd2c314ba185d210cc1175f01d3dd4
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Sep 4 17:55:26 2012 +0200

    VolumeMenu: read output and input if PulseAudio is already ready when constructing
    
    Previously we would only read the default sink and default source when
    the connection to PulseAudio succeded. This worked because all VolumeMenu
    users where initialized synchronously during shell load.
    With the recent session mode changes though, the lock screen menu is
    created on demand, and when it loads PA is already connected, so
    it doesn't update the sliders.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683156

 js/ui/status/volume.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index e0bebed..e96b65c 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -62,6 +62,11 @@ const VolumeMenu = new Lang.Class({
         this._inputSlider.connect('drag-end', Lang.bind(this, this._notifyVolumeChange));
         this.addMenuItem(this._inputTitle);
         this.addMenuItem(this._inputSlider);
+
+        if (this._control.get_state() == Gvc.MixerControlState.READY) {
+            this._readOutput();
+            this._readInput();
+        }
     },
 
     scroll: function(direction) {



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