From 9be7fd20fc48b4f0d9658bfdf9f50117229e7f91 Mon Sep 17 00:00:00 2001 From: italo-capasso Date: Sat, 21 Dec 2024 21:38:07 -0500 Subject: [PATCH] Fix for #529 Appcenter sometimes opens the updates view. This also fix an issue where installed apps would not show up if your did not open the AppListUpdateView until the update worker ended. --- src/Application.vala | 1 + src/MainWindow.vala | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index abd65971f..912f4d1cd 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -225,6 +225,7 @@ public class AppCenter.App : Gtk.Application { if (show_updates) { ((MainWindow) active_window).go_to_installed (); + show_updates = false; } active_window.present (); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index b7b31f46d..2f05e7534 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -145,6 +145,14 @@ public class AppCenter.MainWindow : Gtk.ApplicationWindow { backend.notify["job-type"].connect (update_overlaybar_label); overlaybar.label = backend.job_type.to_string (); + + if (installed_view == null) { + installed_view = new Views.AppListUpdateView (); + + installed_view.show_app.connect ((package) => { + show_package (package); + }); + } } public override bool close_request () { @@ -192,14 +200,6 @@ public class AppCenter.MainWindow : Gtk.ApplicationWindow { } public void go_to_installed () { - if (installed_view == null) { - installed_view = new Views.AppListUpdateView (); - - installed_view.show_app.connect ((package) => { - show_package (package); - }); - } - if (installed_view.parent != null) { navigation_view.pop_to_page (installed_view); } else {