macOS: the Save Diagnostics panel goes behind the editor after an app switch and can't be reached

未关闭 适合新手
#1,667 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
electron, typescript
领域
desktop-dev

调研方向

从 electron/messageBox.ts 中的 showSaveDialogOver(L44-56)开始,阅读其关于 #743 的注释,了解 owner 窗口如何将面板变成 sheet,然后与 electron/ipc/handlers.ts(L1990-1994)中的 exportDiagnosticFile 对比,后者调用 dialog.showSaveDialog 时没有 owner。追踪菜单和 tray 入口点如何到达该 handler,以便将聚焦的窗口作为 owner 传入。当诊断面板附加到编辑器窗口并在 Cmd+Tab 后仍保持在前台时即完成;验证需要 macOS 构建。

由索引模型根据 Issue 内容生成。

描述

bug

On macOS, the save panel opened by Save Diagnostics ends up under the editor window after an app switch. It can then be neither seen nor clicked.

Steps

  1. In the editor, wordmark menu → Save Diagnostics. The "Save Diagnostic File" panel opens in front.
  2. Bring another app to the front (Safari here), then come back with Cmd+Tab.

Expected: the panel stays in front of the editor, or is attached to it as a sheet.

Actual

  • The editor comes back above the panel. The window list holds the panel under the editor, invisible and out of the mouse's reach.
  • Return does nothing, since the panel is not key. The Window menu offers only Minimize, Zoom and Bring All to Front.
  • The save could only be finished through accessibility (AXPress on its Save button). The bundle was then written correctly.

Seen on 2.4.0-rc.1 (DMG), macOS 27.0.1, Mac mini M1.

Why

exportDiagnosticFile calls dialog.showSaveDialog with no owner window (handlers.ts#L1990-L1994). The other save panels go through showSaveDialogOver (messageBox.ts#L44-L56). Its comment describes exactly this trap (#743): unowned, a macOS save panel is a free-floating window that a click sends behind the editor; owned, it is a sheet on that window.

Fix direction

Open the diagnostics panel with showSaveDialogOver, owned by the window the request came from. The menu and tray entry points can pass the focused window.

主要语言
TypeScript
星标
3.7k
派生
231
平均合并
1 天 8 小时
30 天内合并 PR
150

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getopenscreen/openscreen 的其他 Issue

查看 getopenscreen/openscreen 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。