Closed Bug 1876310 Opened 2 years ago Closed 7 months ago

Thunderbird does not satistfy to "do not disturb" for sounds

Categories

(Thunderbird :: General, enhancement)

enhancement

Tracking

(relnote-thunderbird +)

RESOLVED FIXED
142 Branch
Tracking Status
relnote-thunderbird --- +

People

(Reporter: clement.lefevre, Assigned: darktrojan)

References

Details

Attachments

(4 files)

When enabling "Do Not Disturb" in Gnome, notification messages are not displayed anymore. However, Thunderbird is still producing a sound for this.

I know Thunderbird probably sends notification messages to a component and that then this component is responsible for displaying or not depending on the "Do Not Disturb" status while the sound is produced by Thunderbird itself, but maybe Thunderbird could be aware and read such a status itself? Here for Gnome, but probably such a status also exist at least in KDE/Windows/Mac, and I don't know if such a thing is supported there?

Are you using the system notifications?

(In reply to Magnus Melin [:mkmelin] from comment #1)

Are you using the system notifications?

Yes. However, the sound option is separated from this (it's just under it).

I think I can fix this. Unfortunately this feature of Windows seems to be completely undocumented, but I've found some code that looks like it correctly detects Do Not Disturb/Focus Assist/Quiet Hours/whatever they're calling it this week. I've been working on notification sounds lately, so I'll try to work it in.

Depends on: 1973448
Assignee: nobody → geoff
Status: NEW → ASSIGNED

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/52484517da48
Detect if Windows is in Do Not Disturb mode, and don't play sounds if it is. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch

Release Note Request (optional, but appreciated)
[Why is this notable]:
[Suggested wording]: Fixed: Thunderbird notification sounds did not obey Windows do-not-disturb mode.
[Links (documentation, blog post, etc)]:

The message commit seems to imply it's taking care of Windows, is it also considering other OSs/environments?

Backout by vineet@thunderbird.net: https://hg.mozilla.org/comm-central/rev/a8791b7cb810 Backed out changeset 52484517da48 for causing test failures. r=backout
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

(In reply to Clément Lefèvre from comment #7)

The message commit seems to imply it's taking care of Windows, is it also considering other OSs/environments?

No. But we could fairly easily extend it to do so. To be honest, somewhere between reading your initial report and making the patch, I started thinking this was a bug about Windows. I'll figure out how to do Mac and Linux next week sometime.

(In reply to Geoff Lankow (:darktrojan) from comment #9)

(In reply to Clément Lefèvre from comment #7)

The message commit seems to imply it's taking care of Windows, is it also considering other OSs/environments?

No. But we could fairly easily extend it to do so. To be honest, somewhere between reading your initial report and making the patch, I started thinking this was a bug about Windows. I'll figure out how to do Mac and Linux next week sometime.

Well, report was initially about GNOME, therefore Linux.

I'm afraid there's the possibility different window manager/environments deals with this differently though. sometimes there are common rules they mostly agreed with such as Freedesktop and so on, but sometimes not (though, maybe do not disturb concept doesn't exist much outside of the two big environments that are GNOME and KDE/Pasma).

This builds on the Windows version in the previous patch. The test should pass, even on macOS where
the function is unimplemented, because the OS integration is mocked in all cases.

(In reply to Geoff Lankow (:darktrojan) from comment #11)

Created attachment 9497567 [details]
Bug 1876310 - Detect if Linux is in Do Not Disturb mode, and don't play sounds if it is. r=aleca,babolivier

This builds on the Windows version in the previous patch. The test should pass, even on macOS where
the function is unimplemented, because the OS integration is mocked in all cases.

Out of curiosity, what is there a standard it's using for Linux, if yes, does it apply to specific environments or not?
And if I get what you means, there are multiple integrations with the system where it's faked for mac and DNT mode is one them?

As I said on the patch review, most things I read mentioned org.freedesktop.Notifications.Inhibited or org.gnome.desktop.notifications.show-banners as the settings to use, so I'm checking those.

There is system integration code for each of the three desktop platforms. If we need to use that code in tests, we replace the OS integration code with a fake (mock) implementation, since we can't control the OS during an automated test. On Mac, even though we haven't yet implemented the do not disturb parts, the fake implementation still gets used so the test still passes.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/5f372e16a5e7
Detect if Windows is in Do Not Disturb mode, and don't play sounds if it is. r=aleca
https://hg.mozilla.org/comm-central/rev/e7e8f16ceb56
Detect if Linux is in Do Not Disturb mode, and don't play sounds if it is. r=aleca,babolivier
https://hg.mozilla.org/comm-central/rev/447ac918232b
Detect if macOS is in Do Not Disturb mode, and don't play sounds if it is. r=aleca

Status: REOPENED → RESOLVED
Closed: 7 months ago7 months ago
Resolution: --- → FIXED

I didn't update this bit when adding the macOS implementation.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/bf015c928e9a
follow-up - Update docs in nsIMessengerOSIntegration.idl. r=aleca

Thanks for the relnote. I updated it slightly to: "Notification sounds did not respect operating system's do-not-disturb mode"

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: