MainWindow.cs: fix clamping function & avoid saving position and size when minimized or maximized