fix(windows): 校准麦克风权限探测#53
Merged
appergb merged 1 commit intoApr 30, 2026
Merged
Conversation
Reviewer's GuideAdjusts Windows microphone permission detection to first consult privacy registry settings and reduces the frequency of microphone permission probing in the settings page to avoid constant input stream activation, while separating hotkey and permission refresh intervals. Sequence diagram for split hotkey and permission refresh in settings pagesequenceDiagram
actor User
participant Window
participant PermissionsSection
participant TauriBackend
User->>Window: open Settings page
Window->>PermissionsSection: mount
Note over PermissionsSection: Initial refresh
PermissionsSection->>TauriBackend: checkAccessibilityPermission()
PermissionsSection->>TauriBackend: checkMicrophonePermission()
PermissionsSection->>TauriBackend: getHotkeyStatus()
TauriBackend-->>PermissionsSection: accessibility status
TauriBackend-->>PermissionsSection: microphone status
TauriBackend-->>PermissionsSection: hotkey status
Note over PermissionsSection: Start intervals
PermissionsSection->>Window: setInterval(refreshHotkey, 1000ms)
PermissionsSection->>Window: setInterval(refreshPermissions, 10000ms)
loop every 1000ms
Window->>PermissionsSection: refreshHotkey()
PermissionsSection->>TauriBackend: getHotkeyStatus()
TauriBackend-->>PermissionsSection: hotkey status
end
loop every 10000ms
Window->>PermissionsSection: refreshPermissions()
PermissionsSection->>TauriBackend: checkAccessibilityPermission()
PermissionsSection->>TauriBackend: checkMicrophonePermission()
TauriBackend-->>PermissionsSection: accessibility status
TauriBackend-->>PermissionsSection: microphone status
end
Note over Window,PermissionsSection: User switches to system settings
User-->>Window: blur (leave app)
Note over Window,PermissionsSection: User returns from system settings
User->>Window: focus
Window->>PermissionsSection: onFocus handler
PermissionsSection->>TauriBackend: checkAccessibilityPermission()
PermissionsSection->>TauriBackend: checkMicrophonePermission()
PermissionsSection->>TauriBackend: getHotkeyStatus()
TauriBackend-->>PermissionsSection: updated accessibility
TauriBackend-->>PermissionsSection: updated microphone
TauriBackend-->>PermissionsSection: updated hotkey
Note over PermissionsSection: On unmount, clear intervals
PermissionsSection->>Window: clearInterval(hotkeyId)
PermissionsSection->>Window: clearInterval(permissionId)
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
windows_microphone_registry_deniedimplementation shells out toregand parses localized text output on every check; consider switching to a Win32 registry API (e.g., viawinreg/windowscrate) both for performance and to avoid locale/formatting fragility inregistry_value_is_deny. - In
registry_value_is_deny, a non-successregexit status is treated as "not denied" without any logging, which could mask misconfigurations or missing keys; it may be safer to log at least a debug message or distinguish between "no key" and actual errors.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `windows_microphone_registry_denied` implementation shells out to `reg` and parses localized text output on every check; consider switching to a Win32 registry API (e.g., via `winreg`/`windows` crate) both for performance and to avoid locale/formatting fragility in `registry_value_is_deny`.
- In `registry_value_is_deny`, a non-success `reg` exit status is treated as "not denied" without any logging, which could mask misconfigurations or missing keys; it may be safer to log at least a debug message or distinguish between "no key" and actual errors.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
appergb
pushed a commit
that referenced
this pull request
Apr 30, 2026
包含本轮所有合并: - Codex 终审两条 HIGH (cancel race) 修复 (PR #79) - 6 个 Cooper-X-Oak/Codex bot PRs 自动合并 (#44 #49 #53 #68 #72 #73) - 2 个有冲突 PR 本地 rebase 后合并 (#66 cancel + 空转写并存 / #67 Windows docs) - README 破图修复 (PR #80) - workflow-scope 受限的 #48 + #75 由用户在 GitHub UI 直接合并 3 处版本字段同步:package.json + tauri.conf.json + Cargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
关联 fork 验证:Cooper-X-Oak#12。
本 PR 是从 fork/dev 已验证批次拆出的第四个最小 upstream 维护项:校准 Windows 麦克风隐私权限探测,并避免设置页每秒打开输入流导致隐私指示器频繁闪烁。
fork/dev 先行验证
b9ee8b8。修复 / 新增 / 改进
check_microphone()先读取 CapabilityAccessManager 麦克风隐私注册表 Deny 状态。兼容
测试计划
npm run buildopenless-all/app/scripts/windows-build-gnu.ps1git diff --checkSummary by Sourcery
Calibrate Windows microphone permission detection and reduce intrusive probing in the settings page.
Bug Fixes:
Enhancements: