Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon: do not timeout when running under wayland #213

Closed
wants to merge 1 commit into from

Conversation

lukefromdc
Copy link
Member

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
Copy link
Member Author

lukefromdc commented Aug 7, 2023

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.

return;

daemon->exit_timeout_source = g_timeout_add_seconds(IDLE_SECONDS, do_exit, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use X11, it shouldn't be removed here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like an error left over from earlier experiments, I will fix that now

Copy link
Member Author

@lukefromdc lukefromdc Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that error, now we just have the return if not running under x11, should be no change in x11 behavior now. THANK YOU for catching that,it was a leftover from my first experiments and was not supposed to be part of the pushed commit.

@raveit65
Copy link
Member

raveit65 commented Aug 7, 2023

There was already an PR in 2013 to remove dbus-activation in general #10
But i forgot the details why we didn't agree.

Copy link
Member

@zhuyaliang zhuyaliang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No testing, it will not affect X11

@raveit65
Copy link
Member

raveit65 commented Aug 8, 2023

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 #10
Links to freedesktop-notifications specifications you will find in PR above.

@raveit65
Copy link
Member

raveit65 commented Aug 8, 2023

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
Copy link
Member

raveit65 commented Aug 8, 2023

As a proof-of-concept i made a rework of the old PR #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 8a02eb9
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
Copy link
Member Author

Should we close this in favor of #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
Copy link
Member

raveit65 commented Aug 8, 2023

@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
Copy link
Member Author

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

*We need to keep running in current wayland sessions, this might change in the future
*Use of timeout to reduce the number of running daemons may be possible in a future wayland session but not now when running a wayland session from a tty
@lukefromdc
Copy link
Member Author

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

@raveit65 raveit65 closed this Aug 9, 2023
@raveit65 raveit65 deleted the wayland-no-timeout branch August 17, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants