-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
kde plasma desktop notifications timeout #673
Comments
Hi @alexjp ! mmh, I think that it depends on the KDE configuration. As far as I remember on KDE/OpenSuse/kubuntu the timeout works just fine, while on others the pop-up is not hidden after the timeout. I'll try to reproduce it. Maybe it's something related with the connection to DBus. |
KDE has a timeout of 5 seconds to hide system notifications (Notifications -> Application Settings): On a kubuntu 21.04 livecd it works as expected, notifications are automatically closed: However I've got a kubuntu VM installed to disk from the same .iso file, and the notifications are not automatically closed. |
I've got a solution for this problem. Right now there're 3 timeouts:
I propose to set an extra timeout of (pop-ups timeout * 2), to close our system notification just in case everything else fails. What do you think @alexjp ? (I've tried out to lower the urgency level of the notifications, but it didn't make any difference) |
Sorry... I was out and unable to answer sooner!! Sorry!
Well, I would sugest an option that would be: "Use default desktop timeout", which would not set the timeout in the notifications (which seems to be what is causing the issue ). Also, while looking at the code and testing stuff, I noticed in "pynotify2" that is deprecated:
I will try to look at the commits on kde to see what could have changed in the notification system ! Thank you! |
ok, it might be easier to solve. Revert any changes you made, and set opensnitch/ui/opensnitch/notifications.py Line 43 in cbc9d2a
The thing is that in some KDE Installations, setting the mainloop to 'qt' prevented system notifications from working, that's why I left glib. |
I reverted everything and changed mloop from 'glib' to 'qt'. findings: it works if "popups" are enabled and I set the timeout. the timeout number is working properly. there is an issue though: If i disable popups and leave only desktop notifications, the timeout number is disabled, and the notifications stop disappearing. Could there be a timeout for popups and another for notifications ? or more simple, just make the timeout of the popups not be disabled when "popups" aren't enabled ? tl;dr:
what do you think ? ( btw... but a separate issue, but the popups are always appearing in the center, even when configured to appear in another place, might be because i have multiple monitors ) |
new findings:
and idea: about the popups, maybe giving these popups a special class or title, one can make a kwin rule for it, hence solving some issues (like positioning) |
another finding, or "i think i am going crazy": I tried editing the timeout value directly in notifications.py ( instead of reading the settings.conf key, hardcoding it to a value ). and notifications still didn't disappear. So I tried reverting everything, even the mloop = 'qt' ( making it 'glib' again )... and not disabled the popups. and it worked. it seems it just doesn't work if I have desktop notifications while popups are disabled ! does this help in someway ? EDIT more findings: with popups enabled and qt notifications -> everything works properly |
The DBus mainloop should be automatically choosen, for example by reading the environment variable XDG_CURRENT_DESKTOP (maybe Qt already has a helper to get the current DE). If it's KDE, lxQt, etc.. use The system notifications timeout should be controlled by the Desktop Environment. On KDE if we connect properly to the DBus server, the value from System settings -> Notifications -> Hide after ... should be respected.
Correct. No idea why, but it shouldn't happen.
Well, that's because disabling the pop-ups sets the timeout to 0 :) so it's the expected behaviour. In general I think that we already have too many options. If users can personalize part of our behaviour from the DE's settings, it'll be a better usage experience, because they should be used to change it from there (like KDE -> System Settings -> Notifications). |
There have been some issues (#673) informing that the notifications timeout were not working on KDE. On 843412d I wrote that the timeout unit is millisecond, as stated on the docs here: https://notify2.readthedocs.io/en/latest/#notify2.Notification.set_timeout But after some trial and error: - set_timeout() units are in seconds, at least for KDE 5.26.3, Xfce 4.18 and GNOME 43. - not specifying the timeout with set_timeout() lets the Desktop Environment handle the timeout for us, from their respective preferences window. So at least now there're some DEs where the notifications are closed as expected.
hi! I think this issue is fixed on v1.6.0. Now the notifications timeouts are handled by the Desktop Environment (by the dbus server that is in use), and closed after the configured timeout on the DE's preferences. One downside I think is that on some DEs, the notifications are not added to the list of notifications on the systray. On cinnamon and gnome it works as expected, but on KDE it doesn't seem to work. |
Note, this issue is reported as https://bugs.debian.org/1037114 in Debian where it is still unsolved. |
Describe the bug
Thank you for opensnitch!
I am using it on kde plasma, with desktop notifications. But in plasma, the desktop notifications (not the popup boxes) are "permanent", meaning that they don't have a timeout.
I was able to make them temporary by commenting the timeout settings in the notifications.py file.
Is it possible to auto detect if using plasma and remove the timeout settings (so that they are temporary), or make an option for it?
Include the following information:
To Reproduce
Enable the desktop notifications on opensnitch gui.
Wait for opensnitch to write a new rule, and show a desktop notification
Expected behavior (optional)
When opensnitch shows a notification, it should auto disappear by the normal timeout. If any more info is needed, plasma has the notifications history or one can simple check the "events" on opensnitch gui.
Thank you!
The text was updated successfully, but these errors were encountered: