galister/WlxOverlay

DBus Notifications only work once (at least on X11)

Okabintaro opened this issue · 3 comments

I noticed that DBus Notifications only fire once when using X11.
After the first notification arrives it seems that the DBus Listener crashes and doesn't work anymore.
Did some debugging and it seems that you will have to connect to DBus explicitly to make the Observer/Rule matcher work continuously:
image

I tried to do that quickly in the NotificaionManager.RegisterDbusAsync() but it doesn't seem to work:

...
    private async Task RegisterDbusAsync()
    {
        var dbus = Connection.Session;
+       await dbus.ConnectAsync();

        var rule = new MatchRule
        {
            Member = "Notify",
            Interface = "org.freedesktop.Notifications",
            Path = "/org/freedesktop/Notifications",
            Type = MessageType.MethodCall,
            Eavesdrop = true
        };
...

see if it's better with 9e93b01

Seems to work and fixed now. Thanks!

Thank you for fixing this!