Files
SubMiner/backlog/tasks/task-13 - Fix-macos-native-window-bounds-for-overlay-binding.md

2.0 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, references, priority
id title status assignee created_date updated_date labels dependencies references priority
TASK-13 Fix macOS native window bounds for overlay binding Done
codex
2026-02-11 15:45 2026-02-11 16:36
bug
macos
overlay
src/window-trackers/macos-tracker.ts
scripts/get-mpv-window-macos.swift
high

Description

Overlay windows on macOS are not properly aligned to the mpv window after switching from AppleScript window discovery to native Swift/CoreGraphics bounds retrieval.

Implement a robust native bounds strategy that prefers Accessibility window geometry (matching app-window coordinates used previously) and falls back to filtered CoreGraphics windows when Accessibility data is unavailable.

Acceptance Criteria

  • #1 Overlay bounds track the active mpv window with correct position and size on macOS.
  • #2 Helper avoids selecting off-screen/non-primary mpv-related windows.
  • #3 Build succeeds with the updated macOS helper.

Implementation Notes

Follow-up in progress after packaged app runtime showed fullscreen fallback behavior:

  • Added packaged-app helper path resolution in tracker (process.resourcesPath/scripts/get-mpv-window-macos).
  • Added .asar helper materialization to temp path so child process execution is possible if candidate path resolves inside asar.
  • Added throttled tracker logging for helper execution failures to expose runtime errors without log spam.
  • Updated Electron builder extraResources to ship dist/scripts/get-mpv-window-macos outside asar at resources/scripts/get-mpv-window-macos.
  • Added macOS-only invisible subtitle vertical nudge (+5px) in renderer layout to align interactive subtitles with mpv glyph baseline after bounds fix.
  • Increased macOS-only invisible subtitle line-height for multi-line text to improve separation as line count grows.