From eecbd4dd42aad17240d2bae89a64789cea5459d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 23 Oct 2017 10:06:18 +0200 Subject: [PATCH] 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 --- js/ui/windowAttentionHandler.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/ui/windowAttentionHandler.js b/js/ui/windowAttentionHandler.js index d56f6b20b..edd671a2c 100644 --- a/js/ui/windowAttentionHandler.js +++ b/js/ui/windowAttentionHandler.js @@ -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); },