Init PlatformFeatures, ProcCommandLineArgs b4 ShowAsSystemWindow
This commit is contained in:
parent
ca9380bd3f
commit
82a28479cf
2 changed files with 5 additions and 7 deletions
|
|
@ -2399,8 +2399,6 @@ namespace MatterHackers.MatterControl
|
|||
private static string lastSection = "";
|
||||
private static Stopwatch timer;
|
||||
|
||||
public static string PlatformFeaturesProvider { get; set; } = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl";
|
||||
|
||||
public static SystemWindow LoadRootWindow(int width, int height)
|
||||
{
|
||||
timer = Stopwatch.StartNew();
|
||||
|
|
@ -2780,8 +2778,6 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public static async Task<GuiWidget> Initialize(SystemWindow systemWindow, Action<double, string> reporter)
|
||||
{
|
||||
AppContext.Platform = AggContext.CreateInstanceFrom<INativePlatformFeatures>(PlatformFeaturesProvider);
|
||||
|
||||
reporter?.Invoke(0.01, "PlatformInit");
|
||||
AppContext.Platform.PlatformInit((status) =>
|
||||
{
|
||||
|
|
@ -2808,9 +2804,6 @@ namespace MatterHackers.MatterControl
|
|||
reporter?.Invoke(0.8, "Plugins");
|
||||
AppContext.Platform.FindAndInstantiatePlugins(systemWindow);
|
||||
|
||||
reporter?.Invoke(0.9, "Process Commandline");
|
||||
AppContext.Platform.ProcessCommandline();
|
||||
|
||||
reporter?.Invoke(0.91, "OnLoadActions");
|
||||
applicationController.OnLoadActions();
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
}
|
||||
|
||||
// Init platformFeaturesProvider before ShowAsSystemWindow
|
||||
string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl";
|
||||
AppContext.Platform = AggContext.CreateInstanceFrom<INativePlatformFeatures>(platformFeaturesProvider);
|
||||
AppContext.Platform.ProcessCommandline();
|
||||
|
||||
// Get startup bounds from MatterControl and construct system window
|
||||
//var systemWindow = new DesktopMainWindow(400, 200)
|
||||
var (width, height) = RootSystemWindow.GetStartupBounds();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue