Renamed OverlayWindow to OverlayManager. Now discovers all on-screen windows for the Cursor PID and creates/reuses/hides overlay windows dynamically to match. Filters out tiny windows (<100px). Verified: detects 3 windows across monitors. Made-with: Cursor
33 lines
779 B
Python
33 lines
779 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 OverlayManager
|
|
from cursor_flasher.detector import CursorDetector
|
|
|
|
app = NSApplication.sharedApplication()
|
|
|
|
config = Config()
|
|
overlay = OverlayManager(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.")
|