Bug 164986 - [GTK] Notifications API does not respect or expose the "icon" attribute
Summary: [GTK] Notifications API does not respect or expose the "icon" attribute
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-19 07:27 PST by Michael Catanzaro
Modified: 2017-02-04 16:47 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2016-11-19 07:27:14 PST
Our web notifications do not display the icons set by webpages.
Comment 1 Michael Catanzaro 2016-11-19 12:51:50 PST
Hm, it's not straightforward. We have a URI in the UI process, and have to send it to the network process (so that the right proxy settings get used), download the resource there, pass the bytes back to the UI process, and create a GdkPixbuf there. I guess it has to happen asynchronously in WebKitNotificationProvider::show. The NotifyNotification should not be created until the image is ready.
Comment 2 Michael Catanzaro 2017-02-04 11:20:07 PST
Let's start for now with just exposing the property, so it will at least be *possible* for apps to show web notifications with icons, even if WebKit-created notifications don't have icons yet.
Comment 3 Adrian Perez 2017-02-04 16:46:20 PST
(In reply to comment #2)
> Let's start for now with just exposing the property, so it will at least be
> *possible* for apps to show web notifications with icons, even if
> WebKit-created notifications don't have icons yet.

This seems reasonable, because anyway it would be unclear which icon
WebKitGTK+ would use when one is not explicitly defined. I would rather
not have a default fallback icon that trying to guess “too much” and end
up with heuristics. An application which wants to add their own icon may
be better off by connecting to the “WebKitWebView::show-notification”
signal, using a GNotification instead to add the icon (and probably more),
and finally preventing the WebKitGTK+ generic notification. The following
example shows that this is really easy to do:

  https://github.com/aperezdc/revolt/blob/master/revolt/window.py#L142-L158

(Which makes me think: maybe we want to do something like that in Epiphany!)
Comment 4 Adrian Perez 2017-02-04 16:47:40 PST
(In reply to comment #3)
> […] I would rather not have a default fallback icon that trying to guess […]
                                                      ^^^^
                                                      than