windowAttentionHandler: Follow app policy for attention notifications

While window attention notifications are created by the shell itself
rather than applications (most likely as a result of focus stealing
prevention), users still commonly link them to the application for
which they are shown. It makes therefore sense to follow the appropriate
policy set by the user rather than showing them unconditionally.

https://bugzilla.gnome.org/show_bug.cgi?id=779974
This commit is contained in:
Florian Müllner 2017-10-23 10:06:18 +02:00
parent fa276a3349
commit eecbd4dd42

View File

@ -79,6 +79,15 @@ var Source = new Lang.Class({
this.signalIDs = [];
},
_createPoliy: function() {
if (this._app && this._app.get_app_info()) {
let id = this._app.get_id().replace(/\.desktop$/,'');
return new MessageTray.NotificationApplicationPolicy(id);
} else {
return new MessageTray.NotificationGenericPolicy();
}
},
createIcon : function(size) {
return this._app.create_icon_texture(size);
},