[gnome-shell/gnome-3-28] notificationDaemon: support file:// or icon theme names for image-path



commit e7463e38cabbb5b6444b8d3ab760804db1957c48
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Fri Nov 9 02:01:28 2018 -0600

    notificationDaemon: support file:// or icon theme names for image-path
    
    While this sounds counter-intuitive, the image-path hint value might also
    be used with URIs or icon names.
    
    As per freedesktop standard:
      The "app_icon" parameter and "image-path" hint should be either an URI
      (file:// is the only URI schema supported right now) or a name in a
      freedesktop.org-compliant icon theme (not a GTK+ stock ID).
    
    Thus the image-path hint should also be parsed as it happens for the
    app_icon.
    
    Reuse same logic, by falling back on _iconForNotificationData with the
    hint value.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/285
    
    (cherry picked from commit 33b8537bf5ba04f6f67b7f5a2e407c8dafd9ef95)

 js/ui/notificationDaemon.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index 9f085629f..dffb412e0 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -117,10 +117,8 @@ var FdoNotificationDaemon = new Lang.Class({
                  bitsPerSample, nChannels, data] = hints['image-data'];
             return Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
                                                       bitsPerSample, width, height, rowStride);
-        } else if (hints['image-path']) {
-            return new Gio.FileIcon({ file: Gio.File.new_for_path(hints['image-path']) });
         }
-        return null;
+        return this._iconForNotificationData(hints['image-path']);
     },
 
     _fallbackIconForNotificationData(hints) {


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