[gnome-shell] windowAttentionHandler: Follow app policy for attention notifications



commit eecbd4dd42aad17240d2bae89a64789cea5459d3
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Oct 23 10:06:18 2017 +0200

    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 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/windowAttentionHandler.js b/js/ui/windowAttentionHandler.js
index d56f6b2..edd671a 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);
     },


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