Remove the function of minimizing at startup, because it affects the startup position

pull/3613/head
2dust 2023-04-05 09:43:33 +08:00
parent 73ad33dfc9
commit 22475e459d
1 changed files with 9 additions and 9 deletions

View File

@ -194,10 +194,10 @@ namespace v2rayN.Views
spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed; spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed;
if (_config.uiItem.autoHideStartup) //if (_config.uiItem.autoHideStartup)
{ //{
WindowState = WindowState.Minimized; // WindowState = WindowState.Minimized;
} //}
if (!_config.guiItem.enableHWA) if (!_config.guiItem.enableHWA)
{ {
@ -420,11 +420,11 @@ namespace v2rayN.Views
Height = _config.uiItem.mainHeight; Height = _config.uiItem.mainHeight;
} }
IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle(); //IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle();
Graphics g = Graphics.FromHwnd(hWnd); //Graphics g = Graphics.FromHwnd(hWnd);
var dip = 96; //var dip = 96;
var maxWidth = SystemParameters.WorkArea.Width * dip / g.DpiX; var maxWidth = SystemParameters.WorkArea.Width;// * dip / g.DpiX;
var maxHeight = SystemParameters.WorkArea.Height * dip / g.DpiY; var maxHeight = SystemParameters.WorkArea.Height;// * dip / g.DpiY;
if (Width > maxWidth) Width = maxWidth; if (Width > maxWidth) Width = maxWidth;
if (Height > maxHeight) Height = maxHeight; if (Height > maxHeight) Height = maxHeight;
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0) if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)