Repository navigation
支持双击托盘隐藏和恢复管理器窗口 - #148
Merged
qiyinxi merged 2 commits intoNov 13, 2026
Merged
支持双击托盘隐藏和恢复管理器窗口#148
Conversation
单击等系统双击间隔后恢复实例窗口,双击只切换独立 Edge 配置里的管理器窗口。退出时恢复隐藏窗口,并阻止晚到的回调再次隐藏。 Refs ModAVD/ModAVD#188
记录 Windows 激活请求的返回值。用独立测试窗口授予本次测试进程前台权限,对照原生请求和托盘回调的激活结果,并核对窗口身份、消息应答与最近输入。 Refs ModAVD/ModAVD#188
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 13, 2026
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.
双击托盘现在会一起隐藏或恢复独立 Edge 配置里的管理器窗口,保留页面和窗口状态。没有窗口时打开一个;右键“打开管理器”优先恢复已有窗口;默认浏览器回退时只打开管理器。
单击等系统双击间隔过去后再恢复实例窗口。完整双击序列不再漏出单击动作。窗口线程负责计时和取消,回调按顺序执行;正常退出前恢复隐藏窗口,退出后晚到的回调不能再次隐藏窗口。中英文 README 和 API 说明同步更新。
验证使用 go.mod 固定的 Go 1.26.5:
go test ./internal/win ./internal/ui -run 'Test(Tray|EdgeProfileMatches|EdgeProcessWindows|BossKey)' -count=1 -v通过。覆盖完整双击、延迟单击、过期待定消息、回调顺序、回调内关闭、进程身份、窗口筛选及三种退出路径。TestTrayManagerEdgeProbe在独立 LOCALAPPDATA 下运行,并持有独占交互测试锁。真实 Edge 第二次启动交接给已有进程;双窗口连续三轮隐藏和恢复,另一个 profile 不受影响,HWND 和页面请求数不变。最小化恢复、最大化保持、无窗口重开、单击隔离及退出恢复通过。探针以PostMessageW注入托盘消息,菜单打开动作直接调用处理函数,没有人工点击托盘。go vet ./...、Darwin arm64 和 Linux amd64 的交叉go vet ./...、build.ps1 -Go <固定工具链> -Out <隔离目录>通过,CLI 和 GUI 均构建成功。gofmt、git diff --check和隐私扫描通过。前台诊断新增可重跑的
TestTrayManagerForegroundPermissions。设置MODAVD_FOREGROUND_PROBE=1和MODAVD_INTERACTIVE_LOCK=<独占锁文件>后,需要对专用测试窗口点击一次;之后自动核对原生返回值、WM_NULL 应答、前后 HWND/PID 和最近输入时间戳,并对有权限的双击与打开动作作前台硬断言。测试不合成输入,不合并线程输入队列,也不改系统前台设置。无授权请求若恰好成功,会明确记录“未重现拒绝”,不会把任意 PASS 当作因果对照。最终go test ./internal/win ./internal/ui -count=1、静态检查、构建和隐私扫描通过。权限机制见 SetForegroundWindow 文档。最新诊断提交
0db8ed9的 GitHub Actions 六项检查全部通过,包含 Windows 完整 Go 测试、macOS 和 Linux 测试:43432042327。限制:
go test ./... -count=1中其余包通过,但 Windows 拒绝创建或执行internal/avd的avd.test.exe,单独重试仍报Access is denied,原因未确认,没有修改系统安全设置。前台权限已另做受控对照:一次真实点击独立测试窗口后,同一 Edge HWND、相同最近输入时间戳,未授权请求返回 false,且 Edge 正常确认 WM_NULL;测试窗口用 AllowSetForegroundWindow 授权给本次测试进程后,请求返回 true,GetForegroundWindow 为目标 Edge。原生请求、完整 PostMessage 双击序列和打开处理函数连续三轮均激活同一窗口。这确认缺少前台资格足以造成这类探针失败,未发现窗口切换实现缺陷;旧超时现场未采集返回值,无法逐次追溯其唯一原因。没有验证人工托盘点击、实际缺少 Edge 时的默认浏览器回退、模拟器/游戏以及 macOS/Linux 实机。Refs ModAVD/ModAVD#188