diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 234b7d97..31e31912 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -473,6 +473,17 @@ namespace SourceGit _launcher = new ViewModels.Launcher(startupRepo); desktop.MainWindow = new Views.Launcher() { DataContext = _launcher }; desktop.ShutdownMode = ShutdownMode.OnExplicitShutdown; + + // Fix macOS crash when quiting from Dock + if (OperatingSystem.IsMacOS()) + { + desktop.ShutdownRequested += (_, e) => + { + e.Cancel = true; + Dispatcher.UIThread.Post(() => Quit(0)); + }; + } + desktop.Exit += (_, _) => { _ipcChannel?.Dispose();