diff --git a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs index 56f1a7a57..d38b92650 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs @@ -45,6 +45,7 @@ namespace Ryujinx.UI.App.Common private readonly VirtualFileSystem _virtualFileSystem; private Language _desiredTitleLanguage; private CancellationTokenSource _cancellationToken; + private bool _isLoading; private static readonly ApplicationJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); private static readonly TitleUpdateMetadataJsonSerializerContext _titleSerializerContext = new(JsonHelper.GetDefaultSerializerOptions()); @@ -89,6 +90,28 @@ namespace Ryujinx.UI.App.Common } public void LoadApplications(List appDirs, Language desiredTitleLanguage) + { + if (_isLoading) + { + return; + } + + _isLoading = true; + + Thread applicationLibraryThread = new(() => + { + LoadApplicationsReal(appDirs, desiredTitleLanguage); + + _isLoading = false; + }) + { + Name = "GUI.ApplicationLibraryThread", + IsBackground = true, + }; + applicationLibraryThread.Start(); + } + + private void LoadApplicationsReal(List appDirs, Language desiredTitleLanguage) { int numApplicationsFound = 0; int numApplicationsLoaded = 0; diff --git a/src/Ryujinx/Assets/Styles/Styles.xaml b/src/Ryujinx/Assets/Styles/Styles.xaml index 20c435d08..34b0f457c 100644 --- a/src/Ryujinx/Assets/Styles/Styles.xaml +++ b/src/Ryujinx/Assets/Styles/Styles.xaml @@ -108,15 +108,15 @@