From 6e61958c23f4e0a6c791304002b1125befacc6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Tue, 20 Jun 2023 12:48:03 +0200 Subject: [PATCH] ui: let DEs control notifications timeouts 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. --- ui/opensnitch/notifications.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ui/opensnitch/notifications.py b/ui/opensnitch/notifications.py index 452cbc271a..461209b316 100644 --- a/ui/opensnitch/notifications.py +++ b/ui/opensnitch/notifications.py @@ -93,14 +93,6 @@ def show(self, title, body, icon="dialog-information", urgency=URGENCY_NORMAL, c try: ntf = self.ntf2.Notification(title, body, icon) - # timeouts seems to be ignored (on Cinnamon at least) - timeout = self._cfg.getInt(Config.DEFAULT_TIMEOUT_KEY, 15) - # -1 and 0 are special values - if timeout > 0: - timeout = timeout * 1000 - ntf.set_timeout(timeout * 1000) - ntf.timeout = timeout * 1000 - ntf.set_urgency(urgency) ntf.set_category(self.CATEGORY_NETWORK) # used to display our app icon and name.