diff --git a/Launcher2/LauncherWindow.cs b/Launcher2/LauncherWindow.cs index f21188c48..4cd0798fd 100644 --- a/Launcher2/LauncherWindow.cs +++ b/Launcher2/LauncherWindow.cs @@ -70,6 +70,7 @@ namespace Launcher2 { } void FocusedChanged( object sender, EventArgs e ) { + if( Program.ShowingErrorDialog ) return; MakeBackground(); Screen.Resize(); } diff --git a/Launcher2/Program.cs b/Launcher2/Program.cs index fc0168074..d6b4c1d4f 100644 --- a/Launcher2/Program.cs +++ b/Launcher2/Program.cs @@ -10,13 +10,20 @@ namespace Launcher2 { public static string AppDirectory; + public static bool ShowingErrorDialog = false; + [STAThread] static void Main( string[] args ) { AppDirectory = AppDomain.CurrentDomain.BaseDirectory; string logPath = Path.Combine( AppDirectory, "launcher.log" ); + AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; ErrorHandler.InstallHandler( logPath ); LauncherWindow window = new LauncherWindow(); window.Run(); } + + static void UnhandledExceptionHandler( object sender, UnhandledExceptionEventArgs e ) { + ShowingErrorDialog = true; + } } }