Browse Source

Window position settings now check if its inside the bounds of the current screens before saving the X & Y values

pull/55/head
JT 1 year ago
parent
commit
10a4e35048
  1. 14
      StabilityMatrix.Avalonia/App.axaml.cs

14
StabilityMatrix.Avalonia/App.axaml.cs

@ -165,12 +165,16 @@ public sealed class App : Application
mainWindow.Closing += (_, _) =>
{
var validWindowPosition =
mainWindow.Screens.All.Any(screen => screen.Bounds.Contains(mainWindow.Position));
settingsManager.Transaction(s =>
{
s.WindowSettings = new WindowSettings(
mainWindow.Width, mainWindow.Height,
mainWindow.Position.X, mainWindow.Position.Y);
}, ignoreMissingLibraryDir: true);
{
s.WindowSettings = new WindowSettings(
mainWindow.Width, mainWindow.Height,
validWindowPosition ? mainWindow.Position.X : 0,
validWindowPosition ? mainWindow.Position.Y : 0);
}, ignoreMissingLibraryDir: true);
};
mainWindow.Closed += (_, _) => Shutdown();

Loading…
Cancel
Save