From a525769a019fc139d7c4848e5a5eaf1181e0e143 Mon Sep 17 00:00:00 2001 From: Rafael Dias Zendron Date: Mon, 26 Oct 2026 12:17:23 -0300 Subject: [PATCH] Don't refresh updates when closing Preferences without changes (#603) Closing the Preferences window always refreshed the updates list, even when nothing was modified, discarding the current selection and rebuilding the tree for no reason. Only refresh when the blacklisted packages actually changed. --- usr/lib/linuxmint/mintUpdate/mintUpdate.py | 2 +- usr/lib/linuxmint/mintUpdate/preferences.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintUpdate/mintUpdate.py b/usr/lib/linuxmint/mintUpdate/mintUpdate.py index 56a2400c..b47e23db 100755 --- a/usr/lib/linuxmint/mintUpdate/mintUpdate.py +++ b/usr/lib/linuxmint/mintUpdate/mintUpdate.py @@ -1670,7 +1670,7 @@ def _on_preferences_destroyed(self, window): self.preferences_window = None if self.app_restart_required: self.restart_app() - else: + elif window.blacklist_changed: self.refresh(False) def restart_app(self): diff --git a/usr/lib/linuxmint/mintUpdate/preferences.py b/usr/lib/linuxmint/mintUpdate/preferences.py index 9f96a550..805b39ea 100644 --- a/usr/lib/linuxmint/mintUpdate/preferences.py +++ b/usr/lib/linuxmint/mintUpdate/preferences.py @@ -24,6 +24,7 @@ class PreferencesWindow: def __init__(self, parent, show_automation=False): self.parent = parent self.settings = parent.settings + self.blacklist_changed = False gladefile = "/usr/share/linuxmint/mintupdate/preferences.ui" builder = Gtk.Builder() @@ -245,7 +246,9 @@ def _save_blacklist(self, treeview): while iter is not None: blacklist.append(model.get_value(iter, BLACKLIST_PKG_NAME)) iter = model.iter_next(iter) - self.settings.set_strv("blacklisted-packages", blacklist) + if blacklist != self.settings.get_strv("blacklisted-packages"): + self.settings.set_strv("blacklisted-packages", blacklist) + self.blacklist_changed = True def _add_blacklisted_package(self, widget, treeview): dialog = Gtk.MessageDialog(self.window,