Repository navigation
fix(display): keep enumeration alive without source id 0 - #1238
Conversation
Devices with no active source do not necessarily expose source id 0. Looking that id up during startup threw std::out_of_range and aborted the process.
|
No actionable comments were generated in the recent review. Summary by CodeRabbit
WalkthroughWindows 设备拓扑代码现在记录活动路径的 source ID,并使用代表路径选择结果枚举设备。路径不可用或无有效设备时,代码会记录警告并跳过设备或返回 ChangesWindows 显示设备路径选择
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
改了啥呀
std::out_of_range直接终止进程。为啥要改
启动恢复显示状态时会枚举全部显示路径。残缺或虚拟适配器经常没有活动源,源 ID 也不是 0。旧代码用
map::at(0),抛出的std::out_of_range没有被接住,进程以0xC0000409退出。取显示名失败本身只是日志,真正让进程起不来的是这次查表。上游在 LizardByte/libdisplaydevice#146 修过同一处,Sunshine #3770 确认
v2025.409.140403之后不再崩溃。Foundation 仍保留着修之前的写法。上游后来的 undock 布局恢复没有再改这个查表,不在这次范围内。同一条显示路径上,持久化 JSON 解析和源模式索引已经有异常或越界处理,不会以同样的方式在启动时终止进程。
验证
git diff --check