Skip to content

[Bug]: 关机自启动后窗口大小行为异常 #8799

@portablesoft

Description

@portablesoft

操作系统和版本

Windows 11 专业版 25H2 + v2rayN 7.18.0 x64 WPF

预期情况

关机自启动后遵循 guiNConfig.json 中设置的 WindowSizeItem \ MainWindow \ Width+Height 值

实际情况

  • v2rayN 设置为开机启动 + 启动后隐藏窗口模式 + 非管理员身份运行
  • v2rayN 安装位置为 D:\Apps\v2rayN
  • 显示器为 4K 3840x2160 分辨率 + 200% 缩放

晚上正常关机,第二天开机自启动后,v2rayN 并没有读取并应用 guiNConfig.json 中 WindowSizeItem \ MainWindow 所设置的高度与宽度值:

"WindowSizeItem": [
      {
        "TypeName": "MainWindow",
        "Width": 1200,
        "Height": 1032
      }
}

此时打开 guiNConfig.json 直接查看 Width 与 Height 还是为设定的值(1200+1032),但是把 v2rayN 从任务栏双击打开最大化,窗口大小却并不符合这些设定值;接着手动退出 v2rayN 再打开,MainWindow 会被修改为以下的值:

"WindowSizeItem": [
      {
        "TypeName": "MainWindow",
        "Width": 1024,
        "Height": 720
      }
}

我只好关闭 v2rayN 再手动恢复到 1200 与 1032,再打开 v2rayN 才能调整到我需要的窗口大小。请问 1024+720 是怎样来的?v2rayN 对于窗口大小的读取或保存是不是有些问题?

复现方法

关机后自启动 v2rayN

软件日志

[PolicyGroup] [Xray]XHTTP-CDN-策略组
v2rayN - V7.18.0 - X64 | D:\Apps\v2rayN\ | D:\Apps\v2rayN\v2rayN.exe | Microsoft Windows NT 10.0.26200.0
启动服务 (2026/02/13 16:18:32)...
Xray 26.2.6 (Xray, Penetrates Everything.) Custom (go1.25.7 windows/amd64)
A unified platform for anti-censorship.
2026/02/13 16:18:32.366677 [Info] infra/conf/serial: Reading config: &{Name:config.json Format:json}
[PolicyGroup] [Xray]XHTTP-CDN-策略组
2026/02/13 16:18:32.548703 [Warning] core: Xray 26.2.6 started

内核日志

与内核无关

额外信息

2026-02-13 16:15:06.7765-INFO v2rayN start up | v2rayN - V7.18.0 - X64 | D:\Apps\v2rayN\ | D:\Apps\v2rayN\v2rayN.exe | Microsoft Windows NT 10.0.26200.0
2026-02-13 16:15:07.3143-INFO Setup Scheduled Tasks
2026-02-13 16:17:39.2487-INFO AppExitAsync Begin
2026-02-13 16:17:39.4386-INFO AppExitAsync End
2026-02-13 16:17:39.4386-INFO OnExit
2026-02-13 16:17:53.9164-INFO v2rayN start up | v2rayN - V7.18.0 - X64 | D:\Apps\v2rayN\ | D:\Apps\v2rayN\v2rayN.exe | Microsoft Windows NT 10.0.26200.0
2026-02-13 16:17:54.4431-INFO Setup Scheduled Tasks
2026-02-13 16:18:05.5159-INFO AppExitAsync Begin
2026-02-13 16:18:05.5771-DEBUG ConfigHandler,UnauthorizedAccess_IODenied_NoPathName
2026-02-13 16:18:05.6052-DEBUG    at System.IO.FileSystem.MoveFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at ServiceLib.Handler.ConfigHandler.SaveConfig(Config config) in /home/runner/work/v2rayN/v2rayN/v2rayN/ServiceLib/Handler/ConfigHandler.cs:line 198
2026-02-13 16:18:05.7082-INFO AppExitAsync End
2026-02-13 16:18:05.7082-INFO OnExit
2026-02-13 16:18:31.4390-INFO v2rayN start up | v2rayN - V7.18.0 - X64 | D:\Apps\v2rayN\ | D:\Apps\v2rayN\v2rayN.exe | Microsoft Windows NT 10.0.26200.0
2026-02-13 16:18:31.9631-INFO Setup Scheduled Tasks

我确认已更新至最新版本

我确认已查询历史issues

我确认系统版本是受支持的

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions