Files
coucou/scripts/test-display-choice.sh
Steeven 4c4831d732 Choose which screen Mochi lives on
Settings → General → Display: the screen with the notch (default, unchanged
behaviour), the main screen with the menu bar, a specific screen by name, or
Follow the mouse.

- IslandDisplayChoice.swift (new): pure choice + resolver, tested by
  scripts/test-display-choice.sh. A chosen screen is stored by its display
  UUID and falls back to the notch screen while it is disconnected.
- IslandWindowController: relocate(to:) recomputes the resting geometry
  (notch or bar) and moves the panel. Follow the mouse runs in the existing
  60 Hz loop and only moves a hidden or compact island, never an open one.
  The island now follows screen changes (plug, unplug, lid, resolution).
- Settings window and desktop Mochi flights target the island's screen.
- BotCanvasView: eye tracking used the global midX of NSScreen.main against
  a screen-local mouse position, so Mochi looked off on an external screen.
- docs/SPEC.md, README.md, CONTRIBUTING.md updated.
2026-10-05 14:07:28 +02:00

9 lines
311 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-display.XXXXXX")"
trap 'rm -rf "$TEST_DIR"' EXIT
swiftc NotchBuddy/Sources/App/IslandDisplayChoice.swift \
tests/IslandDisplayChoiceTests.swift -o "$TEST_DIR/display-tests"
"$TEST_DIR/display-tests"