mate-desktop / mate-notification-daemon

Daemon to display passive pop-up notifications
https://mate-desktop.org
GNU General Public License v2.0
30 stars 26 forks source link

Daemon: do not timeout when running under wayland #213

Closed lukefromdc closed 1 year ago

lukefromdc commented 1 year ago

When running in any current wayland session we need to keep the daemon alive as restarting it when a notification is sent does not work.

lukefromdc commented 1 year ago

To test, start up a wayfire session (or any other wlroots compositor) and run /usr/libexec/mate-notification-daemon .Alternately add this line under [autostart] to wayfire.ini notifications = /usr/libexec/mate-notification-daemon

From the panel menu, go to System->Preferences->Look and Feel->Popup Notifications and send a test notification or just run notify-send "test" From the Popup Notifications capplet (it works from menu even though mate-control-center doesn't yet run in wayland) you should even be able to move the notification to any corner of the desktop, as previous work to support wayland has already made that possible.

raveit65 commented 1 year ago

There was already an PR in 2013 to remove dbus-activation in general https://github.com/mate-desktop/mate-notification-daemon/pull/10 But i forgot the details why we didn't agree.

raveit65 commented 1 year ago

I am not sure if it is a good idea to disable the timeout for wayland because when using a display-manager to start wayfire session m-d-n works out of box. Also the notify-send command is working fine. When using gdm and creating a gdm-session and i see this environment variable DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1004/bus. This seems to be necessary for dbus-notifications. I am not against to disable the timer but i think this is a temporary hack for using m-d-n with a experimental session started with dbus-launch and not a real solution. So please mark it as temporary solution. The freedesktop-notifications specification is to use dbus-activation or starting the daemon without dbus-activation like in this old PR https://github.com/mate-desktop/mate-notification-daemon/pull/10 Links to freedesktop-notifications specifications you will find in PR above.

raveit65 commented 1 year ago

One advantage to remove dbus-activation in general like in the old PR and starting the daemon via autostart folder, is to avoid conflicts with other installed notification daemons. We have several report with installed kde-notification-daemon. K is before M in the alphabet in result dbus addresses kde-daemon. I do not prefer this solution but it sounds cleaner. Any way i never did test it.

raveit65 commented 1 year ago

As a proof-of-concept i made a rework of the old PR https://github.com/mate-desktop/mate-notification-daemon/pull/214 I like to test this for myself. I think the second commit which removes dbus-activation should be interesting for wayland sessions. Remove exit-on-idle functionality https://github.com/mate-desktop/mate-notification-daemon/pull/214/commits/8a02eb9adfe680b80c2a404582f77af719ff81d9 IHMO, we don't need dbus-activation when exit-on-idle isn't used in wayland. In other words why the daemon should be activated via dbus when the daemon is always running?

lukefromdc commented 1 year ago

Should we close this in favor of https://github.com/mate-desktop/mate-notification-daemon/pull/214 which includes its functionality, keep it open but mark the wayland change as temporary in the commit message and comment in the code, or something else?

raveit65 commented 1 year ago

@lukefromdc Let it open for the moment. @cwendling doesn't want to remove dbus-activation. I don't understand why but this needs to be discussed. When we don't remove dbus-activation than i have to minimum remove the idle timeout, otherwise starting the daemon via session autostart is useless when the timeout kills the daemon.

lukefromdc commented 1 year ago

OK, I will mark this in the message and code as potentially temporary and keep it open. We don't yet know the details of how dbus interaction will work in the finished mate-wayland session

lukefromdc commented 1 year ago

I have changed the comments in the code and the commit message to indicate this could be temporary. Note that x11 behavior should be entirely unaffected by this PR