messageTray: Don't always open the source when clicking on the notification

Some consumers may not always want to open the app, so make clients that
want to do this explicitly connect to the 'clicked' signal.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
This commit is contained in:
Jasper St. Pierre
2013-10-13 23:20:50 -04:00
parent 43f4682ec4
commit 8ee0ef2cde
4 changed files with 31 additions and 19 deletions

View File

@ -39,6 +39,9 @@ const WindowAttentionHandler = new Lang.Class({
let [title, banner] = this._getTitleAndBanner(app, window);
let notification = new MessageTray.Notification(source, title, banner);
notification.connect('clicked', function() {
source.open();
});
notification.setForFeedback(true);
source.notify(notification);
@ -79,7 +82,7 @@ const Source = new Lang.Class({
return this._app.create_icon_texture(size);
},
open : function(notification) {
open: function() {
Main.activateWindow(this._window);
this.destroy();
}