diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2019-12-03 14:33:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-03 14:33:52 +0300 |
commit | 95c46e0376f149838f39119bf5884ba0ca90c2f4 (patch) | |
tree | ef3b13ec2cc1742d935d392ee5050e024718721b /main | |
parent | 80158577a3b055e48ef817238d6ef28f63a9755d (diff) |
[Ide[ Configure Gtk# for slim startup (#9364)
* [Ide[ Configure Gtk# for slim startup
* Fix up startup tracker slices.
Xamarin.Mac is init as part of gtk init, skewing info
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs | 12 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs index b8ace0dbbd..7e467a4e60 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs @@ -76,15 +76,12 @@ namespace MonoDevelop.Components { if (Gtk.Settings.Default != null) throw new InvalidOperationException ("Gtk already initialized!"); - - //HACK: we must initilize some Gtk rc before Gtk.Application is initialized on Mac/Windows - // otherwise it will not be loaded correctly and theme switching won't work. - if (!Platform.IsLinux) - UpdateGtkTheme (); + IdeStartupTracker.StartupTracker.MarkSection ("PreGtkInitialization"); #if MAC // Early init Cocoa through xwt var loaded = NativeToolkitHelper.LoadCocoa (); + IdeStartupTracker.StartupTracker.MarkSection ("XamarinMacInitialization"); var disableA11y = Environment.GetEnvironmentVariable ("DISABLE_ATKCOCOA"); if (Platform.IsMac && (NSUserDefaults.StandardUserDefaults.BoolForKey ("com.monodevelop.AccessibilityEnabled") && string.IsNullOrEmpty (disableA11y))) { @@ -103,6 +100,11 @@ namespace MonoDevelop.Components AccessibilityEnabled = false; } #endif + //HACK: we must initilize some Gtk rc before Gtk.Application is initialized on Mac/Windows + // otherwise it will not be loaded correctly and theme switching won't work. + if (!Platform.IsLinux) + UpdateGtkTheme (); + Gtk.Application.Init (BrandingService.ApplicationName, ref args); // Reset our environment after initialization on Mac diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs index afbbc4a0fe..389cdd31e8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs @@ -82,6 +82,8 @@ namespace MonoDevelop.Ide Environment.SetEnvironmentVariable ("MONO_GC_PARAMS", null); Environment.SetEnvironmentVariable ("MONO_SLEEP_ABORT_LIMIT", null); Environment.SetEnvironmentVariable ("MONO_THREADS_SUSPEND", null); + + Environment.SetEnvironmentVariable ("GTKSHARP_SLIM_STARTUP", "yes"); } int Run (MonoDevelopOptions options) @@ -126,6 +128,8 @@ namespace MonoDevelop.Ide var args = options.RemainingArgs.ToArray (); IdeTheme.InitializeGtk (BrandingService.ApplicationName, ref args); + IdeStartupTracker.StartupTracker.MarkSection ("GtkInitialization"); + startupInfo = new StartupInfo (options, args); if (startupInfo.HasFiles) { @@ -143,6 +147,7 @@ namespace MonoDevelop.Ide LoggingService.LogError ("Unauthorized access: " + ua.Message); return 1; } + IdeStartupTracker.StartupTracker.MarkSection ("IdeCustomizerInitialization"); try { GLibLogging.Enabled = true; @@ -150,7 +155,6 @@ namespace MonoDevelop.Ide LoggingService.LogError ("Error initialising GLib logging.", ex); } - IdeStartupTracker.StartupTracker.MarkSection ("GtkInitialization"); LoggingService.LogInfo ("Using GTK+ {0}", IdeVersionInfo.GetGtkVersion ()); // XWT initialization |