fix(vdisplay/windows): DISPLAYCONFIG_PATH_SOURCE_INFO union field access

modeInfoIdx lives in the Anonymous union (windows-rs), not directly on
sourceInfo — set_virtual_primary_ccd now reads .Anonymous.modeInfoIdx.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-05 09:27:07 +00:00
parent eda7cac78e
commit d23bd9b0cf
@@ -469,7 +469,7 @@ pub(crate) unsafe fn set_virtual_primary_ccd(keep_target_id: u32) -> Option<Save
if p.targetInfo.id != keep_target_id {
return None;
}
let idx = p.sourceInfo.modeInfoIdx as usize;
let idx = p.sourceInfo.Anonymous.modeInfoIdx as usize;
let m = modes.get(idx)?;
(m.infoType == DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE)
.then(|| m.Anonymous.sourceMode.width as i32)
@@ -480,7 +480,7 @@ pub(crate) unsafe fn set_virtual_primary_ccd(keep_target_id: u32) -> Option<Save
// group would share one).
let mut done = std::collections::HashSet::new();
for p in paths.iter() {
let idx = p.sourceInfo.modeInfoIdx as usize;
let idx = p.sourceInfo.Anonymous.modeInfoIdx as usize;
if !done.insert(idx) {
continue;
}