diff options
author | Vsevolod Kukol <sevoku@microsoft.com> | 2020-01-16 20:20:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-16 20:20:41 +0300 |
commit | 194c70aa027ad4db659faeac989e529bb58f841c (patch) | |
tree | a68164aae6740fefdd1048d6f27f5c3da1550741 /main | |
parent | ba6c5ca1c322a6346d2adb0eb3e8908d0269cad9 (diff) | |
parent | 09f0158047e11bd96053d0d05936772efab891b6 (diff) |
Merge pull request #9532 from mono/backport-pr-9526-to-release-8.4
[release-8.4] [Mac] Improve startup reason detection
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/MacPlatform/MacPlatform.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs index 0824931d24..f44e815769 100644 --- a/main/src/addins/MacPlatform/MacPlatform.cs +++ b/main/src/addins/MacPlatform/MacPlatform.cs @@ -350,10 +350,15 @@ namespace MonoDevelop.MacIntegration // At this point, Cocoa should have been initialized; it is initialized along with Gtk+ at the beginning of IdeStartup.Run // If LaunchReason is still Unknown at this point, it means we have missed the NSApplicationDidLaunch notification for some reason and - // we fall back to it being a Normal startup to unblock anything waiting for that notification. + // we fall back to the AppDelegate's version to unblock anything waiting for that notification. if (IdeApp.LaunchReason == IdeApp.LaunchType.Unknown) { - LoggingService.LogWarning ("Missed NSApplicationDidLaunch notification, assuming normal startup"); - IdeApp.LaunchReason = IdeApp.LaunchType.Normal; + if (appDelegate.LaunchReason != AppDelegate.LaunchType.Unknown) { + IdeApp.LaunchReason = appDelegate.LaunchReason == AppDelegate.LaunchType.Normal ? IdeApp.LaunchType.Normal : IdeApp.LaunchType.LaunchedFromFileManager; + } else { + // Fall back to Normal if even the app delegate doesn't know + LoggingService.LogWarning ("Unknown startup reason, assuming Normal"); + IdeApp.LaunchReason = IdeApp.LaunchType.Normal; + } } return loaded; |