Skip to content

Fix microphone, hotkey, and Dock reliability - #934

Closed
altic-dev wants to merge 2 commits into
mainfrom
B/1.6.10-bug-fixes
Closed

Fix microphone, hotkey, and Dock reliability#934
altic-dev wants to merge 2 commits into
mainfrom
B/1.6.10-bug-fixes

Conversation

@altic-dev

@altic-dev altic-dev commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Description

  • Keep ignored microphones suppressed after disconnecting and reconnecting.
  • Stop monitoring global mouse clicks when no mouse shortcut is configured, and harden event-tap cleanup and recovery diagnostics.
  • Ignore recording shortcuts while macOS is locked.
  • Preserve the hidden-Dock preference when reopening an already-running app.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Closes #933
Closes #921
Closes #753
Addresses #884
Related to #657 and #789.

#891 is the separate configured mouse-shortcut ownership case and is not fixed by this PR.

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 27.0
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources
  • Ran formatter locally: swiftformat --config .swiftformat Sources
  • Ran tests locally: 83 targeted integration tests passed
  • Built and installed with sh build_with_FI_incremental.sh
  • Verified locked-screen shortcuts do not start recording
  • Verified the event tap excludes mouse events when no mouse shortcut is configured

Screenshots / Video

  • No UI/visual changes; screenshots/video are not applicable.

Notes

The event tap remains filter-mode because configured shortcuts must be suppressible. This PR narrows its event mask to the configured mouse-button families and recreates it only when that configuration changes. #657 still needs affected-machine soak testing; this PR adds clearer immediate recovery diagnostics and safer tap lifecycle cleanup without claiming full resolution.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T20:38:56.356801Z a948653 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR preserves suppressed microphones across reconnects, reapplies the saved Dock policy when reopening the app, blocks new recording actions while macOS is locked, and narrows/rebuilds the global event tap based on configured mouse shortcuts.

  • Keeps ignored microphone identifiers persisted when devices disconnect.
  • Refreshes mouse monitoring when relevant shortcut settings change.
  • Adds event-tap cleanup, diagnostics, lock detection, and focused integration tests.

Confidence Score: 3/5

The PR should not merge until dynamic event-mask rebuilding preserves modifier-only interruption semantics and avoids prolonged global-shortcut outages after transient recreation failures.

The narrowed mask drops unrelated mouse events that disambiguate modifier-only presses, and the live refresh path destroys a working event tap without promptly retrying when replacement fails.

Files Needing Attention: Sources/Fluid/Services/GlobalHotkeyManager.swift

Fix all with Greploop Fix All in Codex

Prompt To Fix All With AI
### Issue 1
Sources/Fluid/Services/GlobalHotkeyManager.swift:719-730
**Mouse clicks no longer interrupt**

When a user presses a modifier-only recording shortcut and then clicks an unconfigured mouse button, the narrowed event mask drops that click before `markOtherInputDuringModifierOnly()` can mark the press as interrupted. Releasing the modifier is consequently treated as a clean shortcut and can incorrectly start recording.

### Issue 2
Sources/Fluid/Services/GlobalHotkeyManager.swift:553-559
**Tap rebuild loses shortcuts**

When event-tap recreation transiently fails after a mouse-shortcut setting changes, `setupGlobalHotkey()` has already invalidated the working tap and this branch does not invoke the immediate retry path. All global shortcuts remain unavailable until the periodic health check runs, which can take approximately 30 seconds.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix dock and hotkey reliability" | Re-trigger Greptile

Comment on lines +719 to +730
if mouseButtons.contains(0) {
mask |= (CGEventMask(1) << CGEventType.leftMouseDown.rawValue)
| (CGEventMask(1) << CGEventType.leftMouseUp.rawValue)
}
if mouseButtons.contains(1) {
mask |= (CGEventMask(1) << CGEventType.rightMouseDown.rawValue)
| (CGEventMask(1) << CGEventType.rightMouseUp.rawValue)
}
if mouseButtons.contains(where: { $0 >= 2 }) {
mask |= (CGEventMask(1) << CGEventType.otherMouseDown.rawValue)
| (CGEventMask(1) << CGEventType.otherMouseUp.rawValue)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Mouse clicks no longer interrupt

When a user presses a modifier-only recording shortcut and then clicks an unconfigured mouse button, the narrowed event mask drops that click before markOtherInputDuringModifierOnly() can mark the press as interrupted. Releasing the modifier is consequently treated as a clean shortcut and can incorrectly start recording.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: Sources/Fluid/Services/GlobalHotkeyManager.swift
Line: 719-730

Comment:
**Mouse clicks no longer interrupt**

When a user presses a modifier-only recording shortcut and then clicks an unconfigured mouse button, the narrowed event mask drops that click before `markOtherInputDuringModifierOnly()` can mark the press as interrupted. Releasing the modifier is consequently treated as a clean shortcut and can incorrectly start recording.

**Knowledge Base Used:**
- [Voice dictation pipeline](https://app.greptile.com/altic/-/custom-context/knowledge-base/altic-dev/fluidvoice/-/docs/voice-dictation.md)
- [Settings and onboarding](https://app.greptile.com/altic/-/custom-context/knowledge-base/altic-dev/fluidvoice/-/docs/settings-and-onboarding.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

Comment on lines +553 to +559
if !self.setupGlobalHotkey() {
self.isInitialized = false
DebugLogger.shared.error(
"Failed to rebuild event tap after mouse shortcut change",
source: "GlobalHotkeyManager"
)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Tap rebuild loses shortcuts

When event-tap recreation transiently fails after a mouse-shortcut setting changes, setupGlobalHotkey() has already invalidated the working tap and this branch does not invoke the immediate retry path. All global shortcuts remain unavailable until the periodic health check runs, which can take approximately 30 seconds.

Knowledge Base Used: Settings and onboarding

Prompt To Fix With AI
This is a comment left during a code review.
Path: Sources/Fluid/Services/GlobalHotkeyManager.swift
Line: 553-559

Comment:
**Tap rebuild loses shortcuts**

When event-tap recreation transiently fails after a mouse-shortcut setting changes, `setupGlobalHotkey()` has already invalidated the working tap and this branch does not invoke the immediate retry path. All global shortcuts remain unavailable until the periodic health check runs, which can take approximately 30 seconds.

**Knowledge Base Used:** [Settings and onboarding](https://app.greptile.com/altic/-/custom-context/knowledge-base/altic-dev/fluidvoice/-/docs/settings-and-onboarding.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a94865365f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"Mouse shortcut configuration changed; rebuilding event tap",
source: "GlobalHotkeyManager"
)
if !self.setupGlobalHotkey() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry event-tap rebuilds after configuration changes

If CGEvent.tapCreate or enabling the replacement tap fails transiently while a user changes mouse shortcuts, setupGlobalHotkey() has already destroyed the working tap, but this path only sets isInitialized to false. Subsequent shortcut changes then skip rebuilding because of the guard above, leaving all global hotkeys unavailable until the 30-second health check runs. Route this failure through the existing retry/reinitialization mechanism so a configuration edit does not cause an extended hotkey outage.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

FluidVoice PR build ready

Download FluidVoice-PR-934-a94865365fcc

The artifact contains the ad-hoc-signed app ZIP, Xcode archive, build manifest, and installation instructions. It expires 5 days after the build.

Install the app

  1. Extract the downloaded artifact, then extract FluidVoice-PR-934.app.zip.

  2. Move FluidVoice Fix microphone, hotkey, and Dock reliability #934.app into the /Applications folder.

  3. Open Terminal and remove the download quarantine marker:

    xattr -dr com.apple.quarantine "/Applications/FluidVoice #934.app"
    
  4. In Applications, Control-click FluidVoice Fix microphone, hotkey, and Dock reliability #934.app and choose Open.

  5. If macOS still blocks it, open System Settings → Privacy & Security, click Open Anyway, and confirm.

This build has its own app identity, so its permissions are separate from the release version of FluidVoice.

View workflow run

@altic-dev

Copy link
Copy Markdown
Owner Author

Superseded by #937, which merged the independent microphone, Dock, and locked-session fixes. The mouse event-tap changes are intentionally excluded and will be handled separately.

@altic-dev altic-dev closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant