diff --git a/StabilityMatrix.Avalonia/App.axaml.cs b/StabilityMatrix.Avalonia/App.axaml.cs index 34ff5b7d..70f5dcc1 100644 --- a/StabilityMatrix.Avalonia/App.axaml.cs +++ b/StabilityMatrix.Avalonia/App.axaml.cs @@ -152,7 +152,7 @@ public sealed class App : Application var settingsManager = Services.GetRequiredService(); var windowSettings = settingsManager.Settings.WindowSettings; - if (windowSettings != null) + if (windowSettings != null && !Program.Args.ResetWindowPosition) { mainWindow.Position = new PixelPoint(windowSettings.X, windowSettings.Y); mainWindow.Width = windowSettings.Width; diff --git a/StabilityMatrix.Avalonia/Models/AppArgs.cs b/StabilityMatrix.Avalonia/Models/AppArgs.cs index ead4cce4..d3ee5412 100644 --- a/StabilityMatrix.Avalonia/Models/AppArgs.cs +++ b/StabilityMatrix.Avalonia/Models/AppArgs.cs @@ -25,4 +25,9 @@ public class AppArgs /// Whether to disable window chrome effects /// public bool NoWindowChromeEffects { get; set; } + + /// + /// Flag to indicate if we should reset the saved window position back to (O,0) + /// + public bool ResetWindowPosition { get; set; } } diff --git a/StabilityMatrix.Avalonia/Program.cs b/StabilityMatrix.Avalonia/Program.cs index bb488236..d37f84a6 100644 --- a/StabilityMatrix.Avalonia/Program.cs +++ b/StabilityMatrix.Avalonia/Program.cs @@ -12,6 +12,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Threading; +using Microsoft.Extensions.DependencyInjection; using NLog; using Polly.Contrib.WaitAndRetry; using Projektanker.Icons.Avalonia; @@ -44,6 +45,7 @@ public class Program Args.DebugSentry = args.Contains("--debug-sentry"); Args.NoSentry = args.Contains("--no-sentry"); Args.NoWindowChromeEffects = args.Contains("--no-window-chrome-effects"); + Args.ResetWindowPosition = args.Contains("--reset-window-position"); SetDebugBuild();