Commit Graph

3 Commits

Author SHA1 Message Date
Scott Idem
6cddd69891 fix(display): skip mirror/extend if already in requested state
mirror_displays() now checks CGDisplayMirrorsDisplay() for each secondary
before calling CGBeginDisplayConfiguration — avoids a needless display
reconfiguration (and potential flicker) when already mirrored.
extend_displays() already had this check; no change needed there.
2026-05-20 18:24:33 -04:00
Scott Idem
54308c6d4a feat(display): add list-modes and set-mode commands
display_control.m:
  list-modes  — JSON array of all online displays with every usable mode
                (width, height, refresh, pixel_width, pixel_height, hidpi, is_current)
  set-mode <display_index> <width> <height> [--refresh <hz>] [--hidpi] [--no-hidpi]
              — picks best matching CGDisplayMode; auto-prefers HiDPI on
                built-in and non-HiDPI on externals; highest refresh wins on ties

system_handlers.ts:
  native:list-display-modes  — runs binary, parses JSON, returns displays[]
  native:set-display-mode    — runs binary with supplied args

preload/index.ts + shared/types.ts:
  list_display_modes() / set_display_mode() exposed through bridge with full types
2026-05-20 18:16:43 -04:00
Scott Idem
a14c7c7a3f feat(display): add display_control CoreGraphics binary, replace displayplacer as primary path
Derived from OSIT MasterKey app (LegacyUtilities.m, Ian Kohl 2019).
Uses CGConfigureDisplayMirrorOfDisplay — native macOS API, no Homebrew dependency.
Handler now tries display_control first; falls back to displayplacer for missing binary
or per-device configStr overrides. Build the binary via scripts/build-display-control.sh
on a Mac (requires Xcode CLT only), then commit resources/bin/display_control.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 16:48:19 -04:00