diff --git a/gotify_tray/gui/MainApplication.py b/gotify_tray/gui/MainApplication.py index 1bf5308..0e7c1ce 100644 --- a/gotify_tray/gui/MainApplication.py +++ b/gotify_tray/gui/MainApplication.py @@ -232,13 +232,6 @@ class MainApplication(QtWidgets.QApplication): def new_message_callback(self, message: gotify.GotifyMessageModel, process: bool = True): self.add_message_to_model(message, process=process) - # Change the tray icon to show there are unread notifications - if ( - settings.value("tray/icon/unread", type=bool) - and not self.main_window.isActiveWindow() - ): - self.tray.set_icon_unread() - # Don't show a notification if it's low priority or the window is active if ( message.priority < settings.value("tray/notifications/priority", type=int) @@ -246,6 +239,13 @@ class MainApplication(QtWidgets.QApplication): ): return + # Change the tray icon to show there are unread notifications + if ( + settings.value("tray/icon/unread", type=bool) + and not self.main_window.isActiveWindow() + ): + self.tray.set_icon_unread() + # Get the application icon if ( settings.value("tray/notifications/icon/show", type=bool)