Closed Bug 1417846 Opened 7 years ago Closed 8 months ago

requireInteraction:true not working with platform-specific desktop notifications (Linux libnotify)

Categories

(Toolkit :: Alerts Service, defect, P2)

39 Branch
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: robwu, Assigned: saschanaz)

References

(Blocks 3 open bugs)

Details

(Keywords: dev-doc-needed)

Attachments

(2 files, 1 obsolete file)

When the "requireInteraction" option is set to true, a persistent notification should be shown. This seems not to happen on Linux with the libnotify backend. https://bugzilla.mozilla.org/show_bug.cgi?id=862395#c26 wrote some suggestions for implementation, but it seems that nobody ever followed up on that, and requireInteraction is only supported for XUL notifications. STR: 1. Visit about:config and ensure that dom.webnotifications.requireinteraction.enabled is true. 2. Run the following snippet, e.g. from the devtools in a tab: Notification.requestPermission().then(function() { new Notification('hello', {requireInteraction:true}); }); Expected: - A notification shows up that sticks around. Actual: - The notification disappears after 5 seconds. This 5 seconds delay seems to be the default for my system. If I open a terminal and run the following commands, then I can see that the notification disappears at the expected times: $ notify-send hello # gone in 5 seconds (default). $ notify-send -t 1000 hello # gone in 1 second. $ notify-send -t 9000 hello # gone in 9 seconds.
Blocks: 1417848
Component: DOM → Notifications and Alerts
Product: Core → Toolkit
It seems like this should be fixed (as much as platform support allows; see bug 862395 comment 26) so we aren't shipping a half-baked platform feature.
Priority: -- → P2
Severity: normal → S3
Component: Notifications and Alerts → DOM: Notifications
Product: Toolkit → Core

I don't think there's any special thing here to be tracked separately, let's track it in bug 1346375.

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1346375
Resolution: --- → DUPLICATE

Oh actually, you say Linux, so why not track it here.

Status: RESOLVED → REOPENED
Component: DOM: Notifications → Alerts Service
No longer duplicate of bug: 1346375
OS: Unspecified → Linux
Product: Core → Toolkit
Hardware: Unspecified → Desktop
Resolution: DUPLICATE → ---
Summary: requireInteraction:true not working with platform-specific desktop notifications → requireInteraction:true not working with platform-specific desktop notifications (Linux libnotify)

Note for me:

  1. Desktop Notifications spec says "resident" is the hint to control this. https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html
  2. The relevant code in Gecko is nsAlertsIconListener::ShowAlert. (Why is this in toolkit/ when every other nsIAlertsService implementation is in widget/?)
Assignee: nobody → krosylight

clang-tidy's modernize-use-using rule wants to use using instead.

Attachment #9375795 - Attachment is obsolete: true
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a71193097e1b Part 1: Use using instead of typedef r=stransky https://hg.mozilla.org/integration/autoland/rev/bc4d3b22c7eb Part 2: Pass timeout=0 when requireInteraction=true r=stransky
Status: REOPENED → RESOLVED
Closed: 1 year ago8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch

(MDN says requireInteraction is Windows only)

Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: