From 1a5c7704ca7e4affafb482b80400d6e58d69d3e0 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 8 Aug 2026 21:59:57 -0700 Subject: [PATCH] =?UTF-8?q?Land=20both=20=E2=8C=98=E2=8C=98=20routes=20in?= =?UTF-8?q?=20the=20same=20place,=20and=20back=20out=20the=20TrackDrum=20g?= =?UTF-8?q?uard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⌘⌘ has two routes — in process when Menu Band is already running, and the helper's summon over the bridge. The in-process handler arms focus and says so plainly: without touching the popover, because the glow and the rising bell are the cue that it landed. The summon path opened the panel first, so one gesture meant two different things depending on whether the app happened to be running, and the instrument came up behind a panel. It now arms focus and leaves the popover where it was. The contact-renewed resign guard goes back to how it was. Narrowing it to `began` was wrong: the resign worth protecting does not land inside one contact's onset, so TrackDrum exited after a single tap. That is worse than the ghost it was meant to fix, which at least has Escape and ⌘⌘. Both proxies were guesses at an event in another process. The helper's shield swallows the click in its own address space, so this app cannot observe the thing it is trying to absorb, and no function of the contact stream stands in for it — too loose keeps a resting palm alive forever, too tight cuts play off. The helper knows, and already speaks a frame `event` for summon and exit. A click event there is the real fix. --- .../Sources/MenuBand/AppDelegate.swift | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/slab/menuband/Sources/MenuBand/AppDelegate.swift b/slab/menuband/Sources/MenuBand/AppDelegate.swift index bbf2b1dd4b..c5ed00f114 100644 --- a/slab/menuband/Sources/MenuBand/AppDelegate.swift +++ b/slab/menuband/Sources/MenuBand/AppDelegate.swift @@ -714,11 +714,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate { trackpadPlugin.onSummonRequested = { [weak self] in guard let self else { return } // TrackDrum owns the global gesture, including while this app was - // not running. Always leave the gesture at the useful endpoint: - // the popover is visible and keyboard/trackpad focus is armed. - if !self.isPopoverPanelShown { - self.showPopover() - } + // not running. Land it where the in-process ⌘⌘ lands: focus armed, + // popover untouched. Opening the panel here made the same gesture + // mean two different things depending on whether Menu Band + // happened to be running — the glow and the rising bell are the + // cue that it landed, not a panel in the way of the instrument. DispatchQueue.main.async { [weak self] in self?.beginFocusCaptureFromShortcut(keepPopoverOpen: true) } @@ -4863,13 +4863,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate { ) trackpadContactsByID = changes.activeByID #if MAC_APP_STORE - // Only a landing finger can produce the synthesized click this guard - // exists to absorb. Renewing it for every frame that merely *had* a - // contact meant one resting finger held the instrument open forever: - // the pad streams frames continuously, so the window never lapsed, - // every app switch took the `arm()` branch instead, and TrackDrum - // stole focus straight back. A finger already down is not a new click. - if trackpadPluginCaptureActive, !changes.began.isEmpty { + // Renewed from any live contact, which is too loose: a resting finger + // streams frames forever, so the guard never lapses and an app switch + // re-arms instead of exiting — TrackDrum stealing focus back is that + // bug. Narrowing this to `began` broke play instead, because the + // resign worth protecting does not land inside one contact's onset. + // The signal actually wanted is the click the helper's shield ate, + // which only the helper can see; until it reports one over the bridge + // this stays loose on purpose. + if trackpadPluginCaptureActive, !contacts.isEmpty { localCapture.protectNextResignForTrackDrumInput() } #endif -- 2.51.2