Summary: | [GTK] Notifications broken under flatpak and bubblewrap sandbox | ||
---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | aperez, bugs-noreply, mcatanzaro, pgriffis |
Priority: | P2 | ||
Version: | Other | ||
Hardware: | PC | ||
OS: | Linux | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=192748 https://bugs.webkit.org/show_bug.cgi?id=212079 https://bugs.webkit.org/show_bug.cgi?id=240347 |
||
Bug Depends on: | |||
Bug Blocks: | 218121 |
Description
Michael Catanzaro
2017-12-14 08:05:07 PST
Using GNotification would also help us fix https://gitlab.gnome.org/GNOME/epiphany/issues/853. (In reply to Michael Catanzaro from comment #1) > Using GNotification would also help us fix > https://gitlab.gnome.org/GNOME/epiphany/issues/853. We'll need to create a separate WebKit bug for this if we close this one using direct portal access rather than GNotification. But I think GNotification is the way to go. That kills two birds with one stone. GNotification is highly tied to GApplication. So it is unusable in all cases where the application using WebKitGTK doesn't use GApplication. We already assert that applications using the bubblewrap sandbox use GApplication though so maybe thats a direction we want to move towards? I now realize you covered that but using the portal directly probably avoids the need for GApplication. libnotify is honestly awful, everything it does is main thread blocking for example, so its best to avoid it and let it die. So libnotify would be only for fallback regardless. To use the portal directly, we'd still need to rely on GtkApplication for the app ID in order to solve epiphany#853 I guess? Matthias previously indicated he'd allow a libnotify-style portal implementation instead of a GApplication-style implementation, but hopefully we won't need that. (In reply to Michael Catanzaro from comment #5) > So libnotify would be only for fallback regardless. Well, the `org.freedesktop.Notification` service is the fallback. My point is the literal `libnotify` library is bad. > To use the portal directly, we'd still need to rely on GtkApplication for > the app ID in order to solve epiphany#853 I guess? No, every flatpak contains its own id. GApplication is not required: flatpak run --command=sh org.gnome.Epiphany/x86_64/master gdbus call -d org.freedesktop.portal.Desktop -e -o /org/freedesktop/portal/desktop -m org.freedesktop.portal.Notification.AddNotification "''" "{'title': <'foo'>, 'body': <'bar'>}" # Works as expected (In reply to Patrick Griffis from comment #6) > Well, the `org.freedesktop.Notification` service is the fallback. My point > is the literal `libnotify` library is bad. We could stop using it and use org.freedesktop.Notification directly, of course. > > To use the portal directly, we'd still need to rely on GtkApplication for > > the app ID in order to solve epiphany#853 I guess? > > No, every flatpak contains its own id. GApplication is not required: > > > flatpak run --command=sh org.gnome.Epiphany/x86_64/master > gdbus call -d org.freedesktop.portal.Desktop -e -o > /org/freedesktop/portal/desktop -m > org.freedesktop.portal.Notification.AddNotification "''" "{'title': <'foo'>, > 'body': <'bar'>}" > # Works as expected Does WebKit have any way to know the flatpak app ID (other than to hope it's the same as the GtkApplication ID)? (In reply to Michael Catanzaro from comment #7) > Does WebKit have any way to know the flatpak app ID (other than to hope it's > the same as the GtkApplication ID)? Sure we can parse `/.flatpak-info`. (In reply to Michael Catanzaro from comment #0) > Carlos Garcia wants to keep support for libnotify, so we should use > GNotification if there is a GApplication (which will be required for > notifications to work under flatpak), and libnotify otherwise. Since r279369 we made WebKit crash if the bubblewrap sandbox is enabled but GApplication is not used, so IMO we should just drop use of libnotify. Applications that aren't using GApplication surely do not need desktop notifications. Even WPE applications that don't use GtkApplication should be expected to use GApplication, as they should all be sandboxed. Notifications seem to work fine currently, except the urgency is not set properly. I wonder if libnotify learned to use portals. Follow-up bug for GNotification: bug #240347 (In reply to Michael Catanzaro from comment #10) > Notifications seem to work fine currently, except the urgency is not set > properly. I wonder if libnotify learned to use portals. I was testing with Epiphany, but Epiphany handles notifications manually using GNotification. Oops. libnotify 0.8 uses the notification portal now. I still agree it should be migrated away from but it probably resolves this issue. That should certainly resolve this. OK, closing again. P.S. Maybe we could just add an async API to libnotify. Then there wouldn't really be anything wrong with using libnotify anymore? As long as WebKit doesn't block when showing a notification, it's OK? Well, that's a separate issue, for a separate bug report.... (In reply to Michael Catanzaro from comment #14) > P.S. Maybe we could just add an async API to libnotify. Then there wouldn't > really be anything wrong with using libnotify anymore? As long as WebKit > doesn't block when showing a notification, it's OK? Well, that's a separate > issue, for a separate bug report.... I think its worth doing. Upstream seemed on the fence if libnotify should add async API though. |