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
This commit is contained in:
32
scripts/test_overlay.py
Normal file
32
scripts/test_overlay.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""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.")
|
||||
Reference in New Issue
Block a user