fix: picker first-mouse acceptance + event-based drag coords; in-process picker selftest
Root cause: RegionPickerView lacked acceptsFirstMouse — as an LSUIElement accessory app Shotdeck is never active when the hotkey fires, so the user's first click on the overlay was refused and the drag never started. Also plumbs the monitored event's location through the controller (hardware-cursor reads made the chain untestable). Adds PickerSelfTest (SHOTDECK_PICKER_SELFTEST): posts synthetic mouse events through the app's own queue, asserts the exact CaptureRegion, saves a mid-drag overlay bitmap. Coordinator ran it: PICKER-SELFTEST PASS rect=(200.0, 729.0, 400.0, 300.0); overlay bitmap shows dim+punch+chip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@ final class RegionPickerWindow: NSPanel {
|
||||
becomesKeyOnlyIfNeeded = false
|
||||
animationBehavior = .none
|
||||
collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary, .stationary]
|
||||
acceptsMouseMovedEvents = true
|
||||
contentView = pickerView
|
||||
}
|
||||
|
||||
@@ -53,6 +54,8 @@ private final class RegionPickerView: NSView {
|
||||
|
||||
override var isOpaque: Bool { false }
|
||||
override var acceptsFirstResponder: Bool { true }
|
||||
// Accessory-app trap: first click on an inactive overlay is first-mouse and is dropped unless accepted.
|
||||
override func acceptsFirstMouse(for event: NSEvent?) -> Bool { true }
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
super.draw(dirtyRect)
|
||||
|
||||
Reference in New Issue
Block a user