Skip to content

Commit c8538e8

Browse files
notificationDaemon: Fix handling of image-path hint (#12778)
* notificationDaemon: fix incorrect assumption about image-path hint Check if `image-path` is already a file URI before attempting conversion. * fix: cleanup * fix: missing argument gor GLib function
1 parent 253318a commit c8538e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/ui/notificationDaemon.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,12 @@ NotificationDaemon.prototype = {
472472
image = St.TextureCache.get_default().load_from_raw(data, hasAlpha,
473473
width, height, rowStride, notification.IMAGE_SIZE);
474474
} else if (hints['image-path']) {
475-
image = St.TextureCache.get_default().load_uri_async(GLib.filename_to_uri(hints['image-path'], null),
475+
let image_path = hints['image-path'];
476+
// Convert filepaths to file URIs but leave file URIs untouched
477+
if (image_path.substr(0, 7) != 'file://') {
478+
image_path = GLib.filename_to_uri(image_path, null);
479+
}
480+
image = St.TextureCache.get_default().load_uri_async(image_path,
476481
notification.IMAGE_SIZE,
477482
notification.IMAGE_SIZE);
478483
}

0 commit comments

Comments
 (0)