Files
cursor-flasher/scripts/test_overlay.py
cottongin f967575ebc feat: add native macOS overlay window with pulsing border
Uses NSWindow + PulseBorderView with Core Animation-style pulse.
Fixed NSRect handling from plan: uses NSInsetRect instead of
non-existent .insetBy method on pyobjc tuples.

Made-with: Cursor
2026-03-10 02:39:30 -04:00

33 lines
777 B
Python

"""Manual test: shows a pulsing border around Cursor for 10 seconds."""
import sys
import time
from Cocoa import NSApplication, NSRunLoop, NSDate
from cursor_flasher.config import Config
from cursor_flasher.overlay import OverlayWindow
from cursor_flasher.detector import CursorDetector
app = NSApplication.sharedApplication()
config = Config()
overlay = OverlayWindow(config)
detector = CursorDetector()
pid = detector._find_cursor_pid()
if pid is None:
print("Cursor not running")
sys.exit(1)
print(f"Showing overlay for PID {pid} for 10 seconds...")
overlay.show(pid)
end_time = time.time() + 10
while time.time() < end_time:
NSRunLoop.currentRunLoop().runUntilDate_(
NSDate.dateWithTimeIntervalSinceNow_(0.1)
)
overlay.hide()
print("Done.")