Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorVsevolod Kukol <sevoku@microsoft.com>2020-01-16 20:20:27 +0300
committerGitHub <noreply@github.com>2020-01-16 20:20:27 +0300
commit0f5f6f60273099fd2afd8b1eaeeda499f4121537 (patch)
tree3c428a8febef46a4c75133efd7afa93ae0998be6 /main
parenteaa320b3a6d4d1fa214dbd540ee9120c4f5c5643 (diff)
parenta335e89a60edcb4183f9c74bb36e49a8e52be204 (diff)
Merge pull request #9526 from mono/fix-984249
[Mac] Improve startup reason detection
Diffstat (limited to 'main')
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs
index 989ad03ff5..4414821843 100644
--- a/main/src/addins/MacPlatform/MacPlatform.cs
+++ b/main/src/addins/MacPlatform/MacPlatform.cs
@@ -364,10 +364,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;
+ }
}
ideAppleEvents = new MacIdeAppleEvents ();