fix: 最小化后退出MAA保存的离谱位置数值

This commit is contained in:
枫雨
2023-04-13 17:23:34 +08:00
parent 81216d32b4
commit b44bcddda4

View File

@@ -2415,12 +2415,17 @@ namespace MaaWpfGui.ViewModels.UI
/// </summary>
public void SaveGUIParameters()
{
var mainWindow = Application.Current.MainWindow;
if (mainWindow.WindowState != WindowState.Normal)
{
return;
}
// 请在配置文件中修改该部分配置暂不支持从GUI设置
// Please modify this part of configuration in the configuration file.
ConfigurationHelper.SetValue(ConfigurationKeys.LoadPositionAndSize, LoadGUIParameters.ToString());
ConfigurationHelper.SetValue(ConfigurationKeys.SavePositionAndSize, SaveGUIParametersOnClosing.ToString());
var mainWindow = Application.Current.MainWindow;
System.Windows.Forms.Screen currentScreen =
System.Windows.Forms.Screen.FromHandle(new WindowInteropHelper(mainWindow).Handle);
var screenRect = currentScreen.Bounds;