Skip to content

Conversation

@jonathanasdf
Copy link

@jonathanasdf jonathanasdf commented Nov 22, 2025

Note: not well tested, created by claude by heavily referring to https://github.com/MartinGC94/DisplayConfig

Clone/Duplicate Display Support

Overview

Adds comprehensive support for clone (duplicate) displays, allowing multiple monitors to show identical content. Supports pure clone mode or mixed configurations with both cloned and extended displays.

Implementation

Uses Windows CCD API with a two-phase application pattern based on the DisplayConfig PowerShell module:

Phase 1: Enable displays and set clone groups using SDC_TOPOLOGY_SUPPLIED
Phase 2: Apply resolution, refresh rate, and position using SDC_USE_SUPPLIED_DISPLAY_CONFIG

Clone groups are encoded in the modeInfoIdx field:

  • Lower 16 bits: CloneGroupId (displays with same ID mirror content)
  • Upper 16 bits: SourceModeInfoIdx (index into mode array)

Key Changes

  • Profile.cs: Added CloneGroupId property
  • ProfileManager.cs: Clone group detection, validation, and two-phase application
  • DisplayConfigHelper.cs: Complete CCD API implementation with EnableDisplays() and ApplyDisplayTopology()
  • UI: Clone group display/editing with visual indicators (🔗)
  • Performance: WMI query caching

Backward Compatibility

✅ Profiles without CloneGroupId load normally (empty = extended mode)
✅ Existing extended display configurations work unchanged

Testing

  • ✅ Pure clone mode (2+ displays mirroring)
  • ✅ Mixed mode (clone groups + independent displays)
  • ✅ Extended mode (existing functionality)
  • ✅ Display enable/disable with clone groups

@jonathanasdf jonathanasdf force-pushed the duplicate-displays branch 30 times, most recently from 258ce69 to 4ae2810 Compare November 22, 2025 04:14
@jonathanasdf jonathanasdf force-pushed the duplicate-displays branch 28 times, most recently from 32e40f5 to e8bf0b9 Compare November 23, 2025 23:41
Adds support for mirroring multiple monitors with the same content.
Uses Windows CCD API two-phase pattern: enable displays + set clone
groups (Phase 1), then apply resolution/position (Phase 2).

See PR description for full details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants