GNOME Bugzilla – Bug 735747
Follow GNOME notification settings under gnome-shell
Last modified: 2015-10-26 12:28:10 UTC
I set Evolution notifications as follows: Notifications ON Sound Alerts OFF Show Popup Banners OFF Show Details in Banners OFF View in Lock Screen ON Show Details in Lock Screen OFF (the goal is that I don't want to be interrupted in my work by constant arrival of new emails, but when I come back to a lock screen from a break, I like seeing I received new emails, and quickly read them before getting back to work) However, even though « Sound Alerts » is OFF, I still get a beep for new emails. That's because Evolution doesn't use the notification system for this, and instead plays the sound itself. Evolution does have its own settings dialog for the « Mail Notification » plugin, which allows disabling the beep on new email. However, Evolution should instead rely on the notification system, so that the central user configurations are respected.
Also see bug 653699
Thanks for a bug report. I partly agree, but it would be still confusing to have setup in the gnome-shell that the sounds should be off, but in evolution on, and listening no sounds. I even do not know what library they use for this. The notification "banners" are provided by libnotify, which evolution uses (if it's available in build time). I'm pretty sure that we would be able to find other users whom will prefer to have system notification sounds off and Evolution's on, thus I'm WontFix-ing this.
(In reply to Milan Crha from comment #2) > Thanks for a bug report. I partly agree, but it would be still confusing to > have setup in the gnome-shell that the sounds should be off, but in > evolution on, and listening no sounds. The current situation is equally confusing (perhaps more so). Wouldn't a good solution be for Evolution to indicate when sounds are turned off in the shell?
> I partly agree, but it would be still confusing to have setup in the > gnome-shell that the sounds should be off, That's GNOME Control Center, not GNOME Shell where we set this up. ;) > but in evolution on That's exactly the problem: Evolution should ideally not have its own notification settings dialog at all, and instead use the notification system correctly. (at least when run under GNOME, if you want to keep the current code for the cases where Evolution is run on other OSes?) For reference: https://wiki.gnome.org/HowDoI/GNotification
I was asked to reconsider my position on this bug report. If I'd work on this, I need to know couple things, namely: a) how do I know that the Evolution is running under gnome-shell? I can have installed multiple desktop environments, but I'll surely run only one of them at one time (that means that checking for an existence of a .desktop file is not the proper check from my point of view). Is the DESKTOP_SESSION=gnome environment variable a correct way to figure the currently running session properly? b) where do I get the notification settings? It looks like GSettings' org.gnome.desktop.notifications.application-children array should contain 'evolution', then some settings are stored in org.gnome.desktop.notifications.application.evolution, under keys which are not populated unless changed. From what I understand I'm interested only in "enable", "enable-sound-alerts" and "show-banners", though the Mail notification has more settings c) how do I redirect users to gnome-control-center->Notifications->Evolution? Even this might not be necessary, if I'll change those GSettings keys myself in the background, the same as read from them (if they exists) I would use the "evolution" Notifications settings for both mail notifications and event reminders. The GNotification doesn't look appropriate for the Evolution, at least not on the first look, even the hide of the libnotify dependency (which Evolution has as a soft dependency) is promising.
(In reply to Milan Crha from comment #5) > I was asked to reconsider my position on this bug report. If I'd work on > this, I need to know couple things, namely: > > a) how do I know that the Evolution is running under gnome-shell? I can have > installed multiple desktop environments, but I'll surely run only one of > them at one time (that means that checking for an existence of a .desktop > file is not the proper check from my point of view). Is the > DESKTOP_SESSION=gnome environment variable a correct way to figure > the currently running session properly? XDG_CURRENT_DESKTOP == GNOME > b) where do I get the notification settings? You shouldn't access them, they're not for applications to access, they're settings for the notification server, as implemented in gnome-shell. > It looks like GSettings' > org.gnome.desktop.notifications.application-children array should > contain 'evolution', then some settings are stored in > org.gnome.desktop.notifications.application.evolution, > under keys which are not populated unless changed. From what I understand > I'm interested only in "enable", "enable-sound-alerts" and "show-banners", > though the Mail notification has more settings > > c) how do I redirect users to gnome-control-center->Notifications->Evolution? We don't have a way to access those settings for specific applications, but you can launch gnome-notifications-panel.desktop, users should have no problems accessing Evolution from there. > Even this might not be necessary, if I'll change those GSettings keys > myself in the background, the same as read from them (if they exists) Right, which you won't be able to do. > I would use the "evolution" Notifications settings for both mail > notifications and event reminders. The GNotification doesn't look > appropriate for the Evolution, at least not on the first look, even the hide > of the libnotify dependency (which Evolution has as a soft dependency) is > promising. Evolution should: 1) use the notification server to play the sound, so it can be disabled through the notification Settings 2) Evolution shouldn't offer whether or not to show notifications, but in which cases to show notifications (looking at the preferences, it would only be whether to show a notification for mails in INBOX or for all folders).
(In reply to Bastien Nocera from comment #6) > (In reply to Milan Crha from comment #5) > > I was asked to reconsider my position on this bug report. If I'd work on > > this, I need to know couple things, namely: > > > > a) how do I know that the Evolution is running under gnome-shell? I can have > > installed multiple desktop environments, but I'll surely run only one of > > them at one time (that means that checking for an existence of a .desktop > > file is not the proper check from my point of view). Is the > > DESKTOP_SESSION=gnome environment variable a correct way to figure > > the currently running session properly? > > XDG_CURRENT_DESKTOP == GNOME Okay. The is what I get under gnome-shell. My other desktop (MATE) doesn't expose XDG_CURRENT_DESKTOP at all, but it does expose DESKTOP_SESSION. $ set | grep XDG XDG_CURRENT_DESKTOP=GNOME XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/mcrha XDG_MENU_PREFIX=gnome- XDG_RUNTIME_DIR=/run/user/1000 XDG_SEAT=seat0 XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 XDG_SESSION_ID=1 XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0 XDG_VTNR=1 $ set | grep -i gnome DESKTOP_SESSION=gnome GDMSESSION=gnome GNOME_DESKTOP_SESSION_ID=this-is-deprecated GNOME_KEYRING_CONTROL=/home/mcrha/.cache/keyring-OXI2YX XDG_CURRENT_DESKTOP=GNOME XDG_MENU_PREFIX=gnome- > > b) where do I get the notification settings? > > You shouldn't access them, they're not for applications to access, they're > settings for the notification server, as implemented in gnome-shell. Understood, though it would be nice to be consistent with the settings across desktop environments. If I understand this correctly, the I should disable (or hide) the options which are being used by the gnome-shell, when evolution is run under gnome-shell, and offer a button to "Notifications settings" which will call the gnome-notifications-panel.desktop. > 1) use the notification server... Meaning to use libnotify, or the GNotification?
(In reply to Milan Crha from comment #7) > (In reply to Bastien Nocera from comment #6) > > (In reply to Milan Crha from comment #5) > > > I was asked to reconsider my position on this bug report. If I'd work on > > > this, I need to know couple things, namely: > > > > > > a) how do I know that the Evolution is running under gnome-shell? I can have > > > installed multiple desktop environments, but I'll surely run only one of > > > them at one time (that means that checking for an existence of a .desktop > > > file is not the proper check from my point of view). Is the > > > DESKTOP_SESSION=gnome environment variable a correct way to figure > > > the currently running session properly? > > > > XDG_CURRENT_DESKTOP == GNOME > > Okay. The is what I get under gnome-shell. My other desktop (MATE) doesn't > expose XDG_CURRENT_DESKTOP at all, but it does expose DESKTOP_SESSION. The DM (gdm, lightdm, etc.) you're using is broken, or the value is missing from the .session file for MATE. Given that you only need to check for XDG_CURRENT_DESKTOP == GNOME > > > b) where do I get the notification settings? > > > > You shouldn't access them, they're not for applications to access, they're > > settings for the notification server, as implemented in gnome-shell. > > Understood, though it would be nice to be consistent with the settings > across desktop environments. If I understand this correctly, the I should > disable (or hide) the options which are being used by the gnome-shell, when > evolution is run under gnome-shell, and offer a button to "Notifications > settings" which will call the gnome-notifications-panel.desktop. Yep. > > 1) use the notification server... > > Meaning to use libnotify, or the GNotification? Meaning gnome-shell (don't implement your own options when they overlap with notification settings already available).
(In reply to Bastien Nocera from comment #8) > > > 1) use the notification server... > > > > Meaning to use libnotify, or the GNotification? > > Meaning gnome-shell (don't implement your own options when they overlap with > notification settings already available). I'm sorry, but I do not follow. My question is "how do I actually 'use the notification server' in my code"? You wrote above "use the notification server to play the sound", but I do not know how to do that. I'm definitely not going to talk to gnome-shell from the evolution code directly.
Using GNotification or libnotify: https://developer.gnome.org/notification-spec/#hints For example: notify_notification_set_hint (notification, "sound-file", ...);
Thanks for all the pointers. The below change covers both mail notifications and appointment reminders. Created commit c0373e7 in evo master (3.17.3+)
Thanks!
Agreed, thank you very much Milan!
*** Bug 633297 has been marked as a duplicate of this bug. ***
Unfortunately, something is still wrong. I'm running evolution 3.18.1 on Fedora 23. I have disabled sound alerts for Evolution in the GNOME Control Center. And yet, I still got a sound alert for new email when I started Evolution this morning.
(In reply to Mathieu Bridon from comment #15) > And yet, I still got a sound alert for new email when I started Evolution > this morning. I am able to reproduce this under Fedora 23 too. It seems I didn't have installed libcanberra when making the initial change (comment #11). I fixed this with the below change: Created commit 12aa868 in evo master (3.19.2+) Created commit 031359b in evo gnome-3-18 (3.18.2+)
Thanks a lot for being so responsive Milan! Now I'll just patiently wait for 3.18.2 to land in Fedora. :)