From 22475e459ddd57466245dc4845545ceb04617429 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 5 Apr 2023 09:43:33 +0800 Subject: [PATCH] Remove the function of minimizing at startup, because it affects the startup position --- v2rayN/v2rayN/Views/MainWindow.xaml.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index f677d77b..ef8070a8 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -194,10 +194,10 @@ namespace v2rayN.Views spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed; - if (_config.uiItem.autoHideStartup) - { - WindowState = WindowState.Minimized; - } + //if (_config.uiItem.autoHideStartup) + //{ + // WindowState = WindowState.Minimized; + //} if (!_config.guiItem.enableHWA) { @@ -420,11 +420,11 @@ namespace v2rayN.Views Height = _config.uiItem.mainHeight; } - IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle(); - Graphics g = Graphics.FromHwnd(hWnd); - var dip = 96; - var maxWidth = SystemParameters.WorkArea.Width * dip / g.DpiX; - var maxHeight = SystemParameters.WorkArea.Height * dip / g.DpiY; + //IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle(); + //Graphics g = Graphics.FromHwnd(hWnd); + //var dip = 96; + var maxWidth = SystemParameters.WorkArea.Width;// * dip / g.DpiX; + var maxHeight = SystemParameters.WorkArea.Height;// * dip / g.DpiY; if (Width > maxWidth) Width = maxWidth; if (Height > maxHeight) Height = maxHeight; if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)