fix: 加载 Profile 前清除主屏标记,diff 增加取消主屏检测#3
Merged
Merged
Conversation
- load_profile() 开始时调用 set_noprimary() 清除旧主屏标记,防止加载 无主屏配置时保留前一个配置的主屏状态(导致多个主屏共存) - diff_profile() 添加对称检测:当配置中 is_primary=False 而当前显示器是 主屏时输出"取消主显示器"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
修复了两个 Profile 加载相关的逻辑问题:
问题 1: load_profile 加载前未清除主屏标记
set_noprimary()清除所有现有主屏标记is_primary配置时保留旧主屏,导致多个主屏共存问题 2: diff_profile 缺少对称检测
if cur.is_primary and not dc["is_primary"]分支测试覆盖
test_diff_profile_primary_removal测试「取消主显示器」路径set_noprimarymock