! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-notifyd config settings are not honoured for notifications with priorit...
Status:
RESOLVED: MOVED
Product:
Xfce4-notifyd
Component:
general

Comments

Description Carlos Alberto Lopez Perez 2017-05-22 13:09:23 CEST
xfce4-notifyd-config allows to set a not disturb mode, or set a timeout in second for the notification to disappear or tu mute specific applications.

Well, none of this setting has any effect for any application sending notifications with high or urgent priority.

https://developer.gnome.org/gio/stable/GNotification.html#GNotificationPriority

Priority critical is what the documentation of the GIO API recommends to use for real time applications like Chats, IRC, etc.

So its kind of annoying not being able to set the timeout or to mute this notifications.

Example of test program:

#!/usr/bin/env python
import gi
gi.require_version('Gio', '2.0')
from gi.repository import Gio
Application=Gio.Application.new ("hello.world", Gio.ApplicationFlags.FLAGS_NONE);
Application.register ();
Notification=Gio.Notification.new ("Hello world");
Notification.set_body ("This is an example notification.");
Icon=Gio.ThemedIcon.new ("dialog-information");
Notification.set_icon (Icon);
Notification.set_priority(Gio.NotificationPriority.HIGH)
Application.send_notification (None, Notification);


This will cause the notification to appear (without any timeout) no matter what you set on the config of xfce4-notifyd-config (even with "dont disturb" mode enabled).
Comment 1 Simon Steinbeiss editbugs 2017-05-22 21:00:05 CEST
This is not a bug but by design. Urgent notifications should still "punch through" the "do not disturb" so you e.g. still see that your battery is running out.

If messengers use urgent state for their notifications I would suggest they're at fault.

In theory I could add an additional setting to also mute urgent notifications, but I'd rather keep the options to a functional minimum.
Comment 2 Simon Steinbeiss editbugs 2017-05-22 21:04:40 CEST
Oh right, I just read again, you're right, only urgent notifications should be shown. Let me check this again.
Comment 3 Simon Steinbeiss editbugs 2017-05-22 21:11:41 CEST
If you check the freedesktop.org notification specification (https://developer.gnome.org/notification-spec/) there are only three(!) urgency levels.

The way this was implemented in xfce4-notifyd at the moment is that notifications without expire timeout are treated as urgent (instead of actually checking the urgency bit).
Out of curiosity: Which of your messengers use notifications that never expire..? Works for me with pidgin...
Comment 4 Simon Steinbeiss editbugs 2017-05-22 21:30:46 CEST
So this is why it's implemented as it is (again quoting from above spec):
"Critical notifications should not automatically expire, as they are things that the user will most likely want to know about. They should only be closed when the user dismisses them, for example, by clicking on the notification."
Comment 5 Carlos Alberto Lopez Perez 2017-05-22 23:52:21 CEST
(In reply to Simon Steinbeiss from comment #3)
> If you check the freedesktop.org notification specification
> (https://developer.gnome.org/notification-spec/) there are only three(!)
> urgency levels.
> 

Gnotify (GLib >= 2.39) provides 4 levels, check: https://developer.gnome.org/GNotification and https://developer.gnome.org/gio/stable/GNotification.html#GNotificationPriority 

I don't know how this plays with the (previous?) 3 levels defined on https://developer.gnome.org/notification-spec

> The way this was implemented in xfce4-notifyd at the moment is that
> notifications without expire timeout are treated as urgent (instead of
> actually checking the urgency bit).
> Out of curiosity: Which of your messengers use notifications that never
> expire..? Works for me with pidgin...

Revolt (A client for Matrix IM) sends incoming notifications about chats with priority high because its what the documentation of GIO recommends for chat applications.

I have sent a PR to workaround this on the Revolt side [1], but I believe this should be fixed on the XFCE one also. As time passes I would expect more and more chat applications to start using priority high with GIO based notifications.

[1] https://github.com/aperezdc/revolt/pull/55/commits/0d2e955372aa7ffba64a45d66c068fa33253bc77
Comment 6 Simon Steinbeiss editbugs 2017-05-23 01:05:07 CEST
Alright, maybe my comments were too many and therefore misleading.

xfce4-notifyd does NOT honour the urgency or priority levels of the freedesktop.org spec or GLib's GNotification.
Instead it only checks the expire-timeout of notifications to determine whether they are "urgent". If the timeout is 0 (i.e. "never expire") it presumes it's "urgent".

Annoyingly a "high" priority in Gio sets no expire timeout which means that your notification bubbles from chats don't disappear without you clicking and THAT is what I think needs fixing. Presuming an expire-timeout in this case seems wrong when following the freedesktop.org spec at the same time.
Comment 7 Simon Steinbeiss editbugs 2017-09-05 01:09:39 CEST
Ok, I must have been tired when writing that (the hour certainly makes me wonder...).

So: xfce4-notifyd honours the org.freedesktop.Notification "urgent" hint. When a notification is urgent, it sets the timeout to 0. Else it's the value you configure. https://git.xfce.org/apps/xfce4-notifyd/tree/xfce4-notifyd/xfce-notify-daemon.c#n1128

I'm not sure yet why HIGH is also interpreted as URGENT.
Comment 8 Simon Steinbeiss editbugs 2017-12-17 23:35:41 CET
Odd. I don't think I have changed anything relevant in notifyd, but when I poked this bug again today I was not able to reproduce.

Meaning: your reproducer works as it should here and if I bump "HIGH" (expires) to "URGENT" (does not expire) it also works as it should.
Could you please test again with the latest release (0.4.1) or git master? Thanks!
Comment 9 Git Bot editbugs 2020-05-24 20:05:00 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/xfce4-notifyd/-/issues/6.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #13586

Reported by:
Carlos Alberto Lopez Perez
Reported on: 2017-05-22
Last modified on: 2020-05-24

People

Assignee:
Simon Steinbeiss
CC List:
0 users

Version

Attachments

Additional information