Skip to content

OpenUU v0.7.16 — Fix macOS Synced Notification Click Focus / 修复 macOS 点击同步通知聚焦目标远程应用

Latest

Choose a tag to compare

@jacky4kb jacky4kb released this 04 Dec 10:30
· 2 commits to main since this release

English

🔔 Fix macOS Synced Notification Click Opening OpenUU Main Panel Instead of Target Remote App

  • Launch-time UNUserNotificationCenter delegate & race-free click routing:
    • Registered ClientNotificationManager.shared as UNUserNotificationCenter.current().delegate inside applicationDidFinishLaunching (before launch returns) so macOS usernoted reliably delivers notification click callbacks instead of merely activating OpenUU.app.
    • Filtered dismiss actions, buffered cold-launch notification clicks, added [NOTIF] diagnostic logs, and made sessionID::bundleID routing resilient to extra :: separators, case differences, and apps not yet present in remoteApps.
  • Suppress unintended main panel popups when clicking remote notifications:
    • Updated MainPanelCoordinator to distinguish explicit Dock icon clicks from Notification Center activation/reopen events (applicationDidBecomeActive / applicationShouldHandleReopen), deferring auto-open briefly and cancelling/undoing it as soon as a notification click arrives.
    • When OpenUU's main panel was already open in the background and raised solely by clicking a notification, it now quietly tucks back (orderBack) once foreground focus transfers to the remote app.
  • Hardened macOS 14+ cooperative activation handoff to out-of-process Coherence windows:
    • Added pending activation transfer tracking and retries in DockProxyManager so notification clicks arriving slightly before NSApp.isActive still complete yieldActivation the instant OpenUU activates; automatically unhides hidden target proxy apps and pre-yields by bundle ID for newly spawned remote apps.
    • Switched OpenUUProxy child processes to macOS 14+ NSRunningApplication.current.activate(from:options:) cooperative activation, added .firstWindowShown focus handoff for newly opened remote apps, and prevented duplicate .reopenRequested loops during initial startup.

简体中文

🔔 修复控制端 macOS 点击同步通知后误弹 OpenUU 主窗口而非对应远程应用的问题

  • 启动即注册 UNUserNotificationCenter 代理,消除点击回调丢失与路由漏匹配:
    • 将 ClientNotificationManager.shared 改为在 applicationDidFinishLaunching 返回前第一时间注册为 UNUserNotificationCenter.current().delegate,避免系统因代理注册过晚而忽略通知点击回调、仅将 OpenUU.app 拉起至前台;
    • 过滤滑动关闭/忽略通知动作,增加冷启动点击缓冲与 [NOTIF] 结构化日志,并优化 sessionID::bundleID 解析(按首个 :: 拆分、忽略大小写,并在本地应用列表尚未刷新时兜底拉起对应远程应用)。
  • 彻底解决通知点击与主控面板自动弹出的竞态问题:
    • MainPanelCoordinator 区分 Dock 图标主动点击与通知中心唤醒(applicationDidBecomeActive / applicationShouldHandleReopen),对非 Dock 区域唤醒增加短暂延迟与代际取消机制,收到通知点击后立即取消/撤销自动弹出的主窗口;
    • 若 OpenUU 主窗口原本就在后台打开且仅因点击通知被系统顺带拉到前景,在焦点成功移交给远程应用后自动 orderBack 退回后方,不遮挡当前工作区。
  • 加固 macOS 14+ 跨进程协作激活(Cooperative Activation)移交:
    • DockProxyManager 新增待交接激活队列与重试,确保即使通知回调早于 NSApp.isActive 到达,也会在 OpenUU 激活瞬间补发 yieldActivation;支持隐藏状态自动 unhide() 以及新启动远程应用按 bundleID 预让渡激活权;
    • 远程代理子进程(OpenUUProxy)改用 macOS 14+ 原生 NSRunningApplication.current.activate(from:options:) 握手激活,新增 .firstWindowShown 完成新开远程应用窗口的首帧聚焦,并修复子进程启动初期重复发送 .reopenRequested 的问题。