[gnome-shell] [MessageTray] show newly-added sources even if they don't post notifications



commit 82e6f9c8d6e386662e61910e0ea0f5b331ec39ca
Author: Dan Winship <danw gnome org>
Date:   Thu Sep 9 16:18:07 2010 -0400

    [MessageTray] show newly-added sources even if they don't post notifications
    
    eg, when a trayicon is added, show the summary briefly
    
    https://bugzilla.gnome.org/show_bug.cgi?id=608869

 js/ui/messageTray.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index d3be973..3546fa7 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter;
 const Gtk = imports.gi.Gtk;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
+const Meta = imports.gi.Meta;
 const Pango = imports.gi.Pango;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
@@ -983,6 +984,12 @@ MessageTray.prototype = {
             function () {
                 this.removeSource(source);
             }));
+
+        // We need to display the newly-added summary item, but if the
+        // caller is about to post a notification, we want to show that
+        // *first* and not show the summary item until after it hides.
+        // So postpone calling _updateState() a tiny bit.
+        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() { this._updateState(); return false; }));
     },
 
     removeSource: function(source) {



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