From 26026d1357f29df6a938e1e13d5b84d4cf890891 Mon Sep 17 00:00:00 2001
From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>
Date: Sat, 16 Mar 2024 18:46:03 +0000
Subject: [PATCH] Fix Title Update Manager not refreshing app list (#6507)

---
 src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs
index f3ac6960..732f410a 100644
--- a/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs
+++ b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs
@@ -1,4 +1,6 @@
+using Avalonia;
 using Avalonia.Controls;
+using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Interactivity;
 using Avalonia.Styling;
 using FluentAvalonia.UI.Controls;
@@ -59,9 +61,15 @@ namespace Ryujinx.Ava.UI.Windows
         {
             ViewModel.Save();
 
-            if (VisualRoot is MainWindow window)
+            if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime al)
             {
-                window.LoadApplications();
+                foreach (Window window in al.Windows)
+                {
+                    if (window is MainWindow mainWindow)
+                    {
+                        mainWindow.LoadApplications();
+                    }
+                }
             }
 
             ((ContentDialog)Parent).Hide();