[gnome-shell] userMenu: Update the user information if the object is already loaded



commit 543b29efe75e6073f03ba72580a66914b152f7fb
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Sep 8 17:11:45 2011 -0400

    userMenu: Update the user information if the object is already loaded
    
    Any time we get a cached user object from the AccountsService, it will
    already be loaded.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658605

 js/ui/userMenu.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index 24ad418..15a627a 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -194,6 +194,10 @@ IMStatusChooserItem.prototype = {
         this._userChangedId = this._user.connect('changed',
                                                  Lang.bind(this,
                                                            this._updateUser));
+        this.actor.connect('notify::mapped', Lang.bind(this, function() {
+            if (this.actor.mapped)
+                this._updateUser();
+        }));
     },
 
     // Override getColumnWidths()/setColumnWidths() to make the item
@@ -421,6 +425,7 @@ UserMenuButton.prototype = {
         box.add(this._name, { y_align: St.Align.MIDDLE, y_fill: false });
         this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUserName));
         this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUserName));
+        this._updateUserName();
 
         this._createSubMenu();
         this._userManager.connect('notify::is-loaded',



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