diff options
| author | Igor Soarez <igor@soarez.org> | 2026-10-20 15:01:18 +0300 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-10-20 15:01:18 +0300 |
| commit | aa4d6fcd9eac0d0fe051d6307ed6009adefbb2e1 (patch) | |
| tree | c20523f3753f7c04b34f163135d1419094a9838f /menubar/panel.swift | |
| parent | eed9c9c1141e118e43b0055f935dd891d89bebd6 (diff) | |
fix clicks from the menu bar app: find tmux without homebrew on PATH
launchd starts the menu bar app with PATH=/usr/bin:/bin:/usr/sbin:/sbin,
so the `dingger focus` it runs for every click (panel rows, menu rows, the
jump shortcut) could not find homebrew's tmux and failed with a misleading
"no tmux client attached"; the app discarded the error. dingger now finds
tmux on PATH or in the usual install locations (DINGGER_TMUX overrides),
reports a missing tmux as such, and the app logs failed jumps.
also: panel rows own every click inside them (labels took the clicks and
counted as window-drag background).
e2e step 14 repeats the menu bar row click and dingger focus under
launchd's environment; both fail with the previous binaries.
Diffstat (limited to 'menubar/panel.swift')
| -rw-r--r-- | menubar/panel.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/menubar/panel.swift b/menubar/panel.swift index 357ff91..e6ff569 100644 --- a/menubar/panel.swift +++ b/menubar/panel.swift @@ -151,6 +151,15 @@ private class ClickView: NSView { override func acceptsFirstMouse(for event: NSEvent?) -> Bool { true } + // Own every click inside, including over labels: a text field would + // otherwise take the click (and count as a window-drag background). + override func hitTest(_ point: NSPoint) -> NSView? { + bounds.contains(convert(point, from: superview)) ? self : nil + } + + // Dragging is done here (performDrag), not by the window server. + override var mouseDownCanMoveWindow: Bool { false } + override func updateTrackingAreas() { super.updateTrackingAreas() trackingAreas.forEach(removeTrackingArea) @@ -170,6 +179,7 @@ private class ClickView: NSView { } override func mouseUp(with event: NSEvent) { + log("panel: mouse up (dragged: \(dragged))") if !dragged { onClick() } } } |
