Fixed crash on null screen from position
MODIFY
WalletWasabi.Fluent/Behaviors/MainWindowPersistPositionBehavior.cs
WalletWasabi.Fluent/Behaviors/MainWindowPersistPositionBehavior.cs
@@ -80,14 +80,18 @@ public class MainWindowBindPositionBehavior : DisposingBehavior<Window>
var currentScreen = AssociatedObject.Screens.ScreenFromPoint(AssociatedObject.Position);
var isValidWidth =
- vm.WindowWidth * currentScreen.PixelDensity <= currentScreen.WorkingArea.Width * currentScreen.PixelDensity;
+ currentScreen is { } && vm.WindowWidth * currentScreen.PixelDensity <= currentScreen.WorkingArea.Width * currentScreen.PixelDensity;
var isValidHeight =
- vm.WindowHeight * currentScreen.PixelDensity <= currentScreen.WorkingArea.Height;
+ currentScreen is { } && vm.WindowHeight * currentScreen.PixelDensity <= currentScreen.WorkingArea.Height;
if (!isValidWidth || !isValidHeight)
{
vm.WindowState = WindowState.Maximized;
+ AssociatedObject.Position = PixelPoint.Origin;
+ currentScreen = AssociatedObject.Screens.ScreenFromPoint(AssociatedObject.Position);
+ vm.WindowHeight = currentScreen.WorkingArea.Height;
+ vm.WindowWidth = currentScreen.WorkingArea.Width;
}
}
}

MODIFY
WalletWasabi.Fluent/UiConfig.cs
WalletWasabi.Fluent/UiConfig.cs
@@ -60,7 +60,7 @@ public class UiConfig : ConfigBase
x => x.WindowWidth,
x => x.WindowHeight,
(_, _, _, _, _) => Unit.Default)
- .Throttle(TimeSpan.FromMilliseconds(500))
+ .Throttle(TimeSpan.FromMilliseconds(750))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(_ => ToFile());

Fixed crash on null screen from position