Bug 243255 - [GTK] Desktop notifications are not shown in GNOME
Summary: [GTK] Desktop notifications are not shown in GNOME
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Nobody
URL: https://ttsvetko.github.io/HTML5-Desk...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-27 10:20 PDT by Sergio Villar Senin
Modified: 2022-07-28 07:41 PDT (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 Sergio Villar Senin 2022-07-27 10:20:57 PDT
Steps to reproduce:

1. visit https://ttsvetko.github.io/HTML5-Desktop-Notifications/
2. enter some text for title and body of the notification and click "Display Notification" button

Expected result:
A desktop notification is shown

Actual result:
No desktop notification is shown
Comment 1 Sergio Villar Senin 2022-07-27 10:28:30 PDT
I've just realized that the notification is properly sent. The things is that the desktop decides not to show it immediately but instead silently queue it in the notification area (which is usually hidden).

Perhaps it's just a matter of setting a different priority or type on the notification so that desktop shows it. With the current status, it looks like desktop notifications are not working.

For reference, the same page in Firefox or Chrome shows the desktop notification in real time.
Comment 2 Michael Catanzaro 2022-07-27 11:39:24 PDT
Users have been complaining about this for a while. Basically all of the code here is in webkitWebViewShowNotification in WebKitWebView.cpp. Not sure what's wrong.
Comment 3 Carlos Garcia Campos 2022-07-28 03:38:18 PDT
I guess you have tried with epiphany, not MiniBrowser. It works fine in MiniBrowser and the problem is epiphany setting all notifications as low urgency and gnome-shell never showing popups for low urgency notifications:

https://gitlab.gnome.org/GNOME/epiphany/-/blob/master/src/ephy-shell.c#L1010
https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageTray.js#L765
Comment 4 Sergio Villar Senin 2022-07-28 06:49:21 PDT
(In reply to Carlos Garcia Campos from comment #3)
> I guess you have tried with epiphany, not MiniBrowser. It works fine in
> MiniBrowser and the problem is epiphany setting all notifications as low
> urgency and gnome-shell never showing popups for low urgency notifications:

Right, I've just tried MB as well and saw the same
 
> https://gitlab.gnome.org/GNOME/epiphany/-/blob/master/src/ephy-shell.c#L1010
> https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageTray.
> js#L765
Comment 5 Michael Catanzaro 2022-07-28 07:40:11 PDT
(In reply to Carlos Garcia Campos from comment #3)
> I guess you have tried with epiphany, not MiniBrowser. It works fine in
> MiniBrowser and the problem is epiphany setting all notifications as low
> urgency

Where do you see that? Epiphany does not touch the GNotificationPriority, so they should use G_NOTIFICATION_PRIORITY_NORMAL.
Comment 6 Michael Catanzaro 2022-07-28 07:41:48 PDT
(In reply to Michael Catanzaro from comment #5) 
> Where do you see that? Epiphany does not touch the GNotificationPriority, so
> they should use G_NOTIFICATION_PRIORITY_NORMAL.

Oh, I see you already fixed it in https://gitlab.gnome.org/GNOME/epiphany/-/commit/45efd6da62991fad1388ebda837e50ed7b5b3be2.

Next time, if you use a permanent link like https://gitlab.gnome.org/GNOME/epiphany/-/blob/8d5130cb13fb9a0609ce6c9f7b826fcbc260df28/src/ephy-shell.c#L1010 you can avoid confusing me. :)