Notifications (mails, downloads) on Linux not appearing

Discussion of bugs in Seamonkey
teruna
Posts: 18
Joined: March 17th, 2015, 2:50 am

Notifications (mails, downloads) on Linux not appearing

Post by teruna »

Hello,

I am experiencing an annoying problem with the current version 2.33 under Linux (KDE). Whilst version 2.32.1 correctly displays a notification of new mails or completed downloads, the current version does not. There is no graphical feedback at all. If I, however, activate a sound to play at the reception of new mails, it is played. So the problem seems to be related to the graphical notification part. However, I am not able to track this problem down, since I do not even know which files in the source code are responsible for this task.

By the way, the current Thunderbird displays notifications without problems. I guess that this suggests a problem with the Seamonkey-specific part of the code, correct?

The problem appears with the current SeaMonkey provided by ArchLinux, but also with the official one from the SeaMonkey homepage. It is also not related to my profile, as I also cannot see notifications with a fresh SeaMonkey profile and even not with a new KDE account that I created for testing purposes.

Does anyone have an idea what to do?

Best,
teruna
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

Re: Notifications (mails, downloads) on Linux not appearing

Post by barbaz »

What happens if you open the Error Console (Ctrl-Shift-J) and try to evaluate the following code?

Code: Select all

Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService).showAlertNotification('chrome://branding/content/icon48.png', 'Test', 'This is a useless notice.');
teruna
Posts: 18
Joined: March 17th, 2015, 2:50 am

Re: Notifications (mails, downloads) on Linux not appearing

Post by teruna »

Interesting, it opens KDE's own notification popup in the panel. Was the behaviour changed from 2.32 to 2.33, and if yes, is there maybe a way to re-enable SeaMonkey's own notifications?
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

Re: Notifications (mails, downloads) on Linux not appearing

Post by barbaz »

teruna wrote:Interesting, it opens KDE's own notification popup in the panel. Was the behaviour changed from 2.32 to 2.33

Probably.. I recall a while back I was testing Nightlies in Ubuntu 12.04 Unity environment and at one point noticed it had switched to Unity's notifications for that code...

Anyway, maybe that isn't relevant. When you expect a notification for download or email does it show up in the KDE notifications?
(I had thought it was all the same deal.. maybe not.....)

teruna wrote:if yes, is there maybe a way to re-enable SeaMonkey's own notifications?

No idea.
teruna
Posts: 18
Joined: March 17th, 2015, 2:50 am

Re: Notifications (mails, downloads) on Linux not appearing

Post by teruna »

No, I do not see any kind of notification for completed downloads or new mails.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

Yeah, I think it was switched back to use libnotify on Linux. I've noticed that as well (on KDE) after the most recent update, but can't identify any matching bug report. :?
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

So, I've just received a message in my Inbox and the KDE notification was not shown. Definitely something smelling buggy here, though I'm sure it worked initially after the update...
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

Found the culprit after all: Bug 858919 - Web Notifications support does not integrate with libnotify.
Thus, either a bug in or a regression triggered by that change.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

I've had a look at the code and there are some differences in comparison with the Windows system notifications. The "balloon" notifications can be selected by the user separately, thus whether or not they are used for Windows is decided by a preference setting (only visible in Windows). In contrast, on Linux, the code first tries to talk to libnotify and uses it, then returns if that attempt was successful; if not, SeaMonkey's own XUL notification is used. Thus, my guess is that sending the alert to libnotify is either silently reported as a success even though it fails for whatever reason, or the resulting failure code isn't correctly interpreted and therefore the built-in alert isn't triggered as a fallback. Since the old libnotify implementation was broken in 2.32.1 and earlier, the fallback alert was always used until that bug got fixed (not quite so, apparently).

Thus, we may have two bugs here: One being a communication problem with libnotify, the other the lack of parity with the Windows implementation to allow the user to make that choice.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

I've just filed the following bug reports which you may want to follow:

  • Bug 1144693 - New-mail notifications not always working since bug 858919 enabled libnotify usage on Linux again
  • Bug 1144719 - Allow the user to decide whether or not to use libnotify for new-mail alerts on Linux
The first bug may be moved to Toolkit for the larger problem of other alerts not functioning either; otherwise, a solution for the mail alerts may be used as template for other alerts if there is no common fix.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

As of right now, I'm getting notifications again on the desktop, weird. However, they are incomplete and only state the account along with a preview of the message text, but neither the sender nor the subject are provided in the notification.
teruna
Posts: 18
Joined: March 17th, 2015, 2:50 am

Re: Notifications (mails, downloads) on Linux not appearing

Post by teruna »

rsx11m wrote:I've just filed the following bug reports which you may want to follow:

Great, thank you very much! :) I would prefer to circumvent libnotify and keep receiving notifications from SM's own system, mainly for the reasons that you mentioned in the second bug report.

By the way, I now tried to compile SeaMonkey myself using "ac_add_options --disable libnotify", but the result is somewhat opposed to what I expected: I thought that such a built would completely get rid of libnotify and use the fallback notifications. However, it gives notifications using KDE's system. They are incomplete, e.g. without any message preview.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

Since you have a build already, here the workaround how to disable use of libnotify in mail/news alerts at least:

In mailnews/base/src/nsMessengerUnixIntegration.cpp, line 327, replace

Code: Select all

if (NS_SUCCEEDED(rv)) {
with

Code: Select all

if (false) {
and you should get the old XUL notification again. This works for me with both SeaMonkey and Thunderbird trunk builds (and also is an indication that the alert itself still works, just the notification to KDE doesn't work).

As for disabling libnotify in .mozconfig, I'm not aware of that option (but it should be "--disable-libnotify" as a single argument in this way).
teruna
Posts: 18
Joined: March 17th, 2015, 2:50 am

Re: Notifications (mails, downloads) on Linux not appearing

Post by teruna »

Fabulous, thanks a lot! :) I can confirm that this change also re-enables the XUL notification for new mails with SeaMonkey 2.33.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: Notifications (mails, downloads) on Linux not appearing

Post by rsx11m »

You are welcome. I'll give the pref-based switch a try, let's hope that it will make it to avoid having to compile our own version with each release. :roll:
Post Reply