[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
This commit is contained in:
Dan Winship 2010-09-09 16:18:07 -04:00
parent ae9360659d
commit 82e6f9c8d6

View File

@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter;
const Gtk = imports.gi.Gtk; const Gtk = imports.gi.Gtk;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const Pango = imports.gi.Pango; const Pango = imports.gi.Pango;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const Signals = imports.signals; const Signals = imports.signals;
@ -983,6 +984,12 @@ MessageTray.prototype = {
function () { function () {
this.removeSource(source); 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) { removeSource: function(source) {