Skip to content

Commit ff8ad5b

Browse files
committed
fix: theme not loaded when displaying the message box when an instance is already running
1 parent 49944c4 commit ff8ad5b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

sources/launcher/Stride.Launcher/App.axaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public override void OnFrameworkInitializationCompleted()
4444
DataContext = InitializeMainViewModel()
4545
};
4646
}
47-
48-
base.OnFrameworkInitializationCompleted();
4947
}
5048

5149
private static MainViewModel InitializeMainViewModel()
@@ -64,3 +62,9 @@ private static IViewModelServiceProvider InitializeServiceProvider()
6462
return new ViewModelServiceProvider(services);
6563
}
6664
}
65+
66+
// This app is used for the crash report or for the notification when an instance is already running
67+
internal sealed class MinimalApp : App
68+
{
69+
public override void OnFrameworkInitializationCompleted() { }
70+
}

sources/launcher/Stride.Launcher/Launcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async Task AppMainAsync(CancellationTokenSource cts)
101101
static void DisplayError(string message, MessageBoxImage image)
102102
{
103103
// Note: because we are not running from the main loop, we have to start a new app
104-
Program.RunNewApp<Application>(AppMain);
104+
Program.RunNewApp<MinimalApp>(AppMain);
105105

106106
CancellationToken AppMain(Application app)
107107
{
@@ -194,7 +194,7 @@ static async Task<bool> DisplayMessageAsync(string message)
194194

195195
private static void CrashReport(CrashReportArgs args)
196196
{
197-
Program.RunNewApp<Application>(AppMain);
197+
Program.RunNewApp<MinimalApp>(AppMain);
198198

199199
CancellationToken AppMain(Application app)
200200
{

0 commit comments

Comments
 (0)