galister / WlxOverlay

A simple OpenVR overlay for Wayland and X11 desktops
GNU General Public License v3.0
127 stars 6 forks source link

DBus Notifications only work once (at least on X11) #11

Closed Okabintaro closed 1 year ago

Okabintaro commented 1 year ago

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
        };
...
galister commented 1 year ago

see if it's better with https://github.com/galister/WlxOverlay/commit/9e93b01225f0478d402466131e38853baa27e27d

Okabintaro commented 1 year ago

Seems to work and fixed now. Thanks!

VRcontrib commented 1 year ago

Thank you for fixing this!