Closed hannes101 closed 3 years ago
Sorry it isn't clear to me which the problem really is for you. Our code does not close notification. 2.1.x added pystray notification instead of pynotify since the were conflicting using both in our experience. According to last documentation to remove notification we should need to do it by direct calling _removenotification() but we didn't use any timer before an either now. If that is what you meant this is a workforme.
Of course it's not dnfdragora, which closes the notification, but I suspect that the switch from pynotify to pystray might be the cause for the changed behaviour. Perhaps this new implementation is not properly implemented in Xfce. I will investigate with the Xfce devs, if this is more on their side. Thanks for the quick reply.
I've opened an upstream bug at Xfce, https://gitlab.xfce.org/apps/xfce4-notifyd/-/issues/41
I upgraded from F32 to F33 recently and confirm the issue. Session dbus monitoring has shown that notification requests coming from dnfdragora-updater
have zero expiration timeout. According to freedesktop.org notifications spec:
If -1, the notification's expiration time is dependent on the notification server's settings, and may vary for the type of notification. If 0, never expire.
That's why notification balloons don't dissappear automatically. The reason is hard-coded zero in pystray dbus backend. Thus, the only way to hide the balloon is to call pystray's hide()
method explicitly.
But where is the bug then, pystray, xfce4-notifyd or in dnfdragora? Just to make sure it can be fixed in the right places.
I think, it should be fixed in dnfdragora - close the notification balloon explicitly, as meant by pystray
authors.
well when we used pynotify we didn't close notification at all. KDE has a list of notification that must be close by user as far as i know, but notify compare only for a while.. is there a freedesktop specification for notification behavior, so that closing an issue for xfce does not mean opening a new one on another desktop? (adding @Conan-Kudo to see what he thinks about this too)
Right, the balloons closed automatically because notify2
sets _expiretimeout = -1 by default (see here). As spec says, in this case it's up to notification daemon how to treat the balloon. xfce4-notifyd
daemon closes such notifications in one second, but one of KDE/Plasma might have another defaults.
So pystray cannot have the same behavior since they hardcoded 0, right?
Yes. Balloons for pystray
notifications are non-expiring and could be closed either by mouse click or programmatically.
well, that means we'll see how we could manage it then... if someone had patches to provide... he's welcome too :D Thanks to all for pointing us that
It isn't necessary to explicitly close the nofitication in order for the bubble to disappear in xfce4-notifyd.
If a notification is marked as "urgency:critical" xfce4-notifyd doesn't close it automatically which is what the spec says (see here: https://developer.gnome.org/notification-spec/)
So my presumption (without having read the code) is you set this urgency hint and a lower level would make the notification expire automatically.
@ochosi there is no way to set urgency hint for a notification using pystray
, because hints parameter is hardcoded as well (empty list).
I opened an issue here https://github.com/moses-palmer/pystray/issues/84
upstream seems to have accepted the suggestion to use -1! Please let us know if it works now
Great! Will this fix be shipped on Xfce 4.16?
On Wed, 10 Feb 2021 at 18:49, Angelo Naselli notifications@github.com wrote:
upstream seems to have accepted the suggestion to use -1! Please let us know if it works now
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/manatools/dnfdragora/issues/178#issuecomment-776894017, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJXQ7IECYNEDUV7VFDMLDS6LBLNANCNFSM4VRWPX4Q .
well it should be pystray only...
Can confirm that with the newest version of pystray (0.17.3) the balloon disappears automatically.
great, so we should revert the code then before closing this issue :)
Packaging request for Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1903824#c4
I made a scratch build for fedora 33. https://koji.fedoraproject.org/koji/taskinfo?taskID=65149500
Updates for Fedora 34 and 35 (currently in development) are available. Fedora 32 and 33 might not get fixes. See details in above bug description.
I can't exactly say, when this issue started to happen, it was not that long ago. Previously the notification of dnfdragora-update that X updates are available just vanished after the defined time of the Xfce notification plugin. But now it does not disappear anymore and it always require a click on the notification to go away. This is on a fully upgraded fedora 33 with Xfce 4.14 and dnfdragora-2.1.0-2. All other notifications work as expected, but of course this could also be a bug in Xfce.