Commit 709613b
fix(PopupPanel): restore focus to previous app after dismissing input panel (#55)
* fix(PopupPanel): restore focus to previous app after dismissing input panel (#53)
When using the input translation mode (⌥A), the app activates itself to
receive keyboard events. After dismissing the panel, focus was not being
returned to the user's previous working app, interrupting the workflow.
Fix by recording NSWorkspace.shared.frontmostApplication before activation
and restoring focus to the previous app after panel dismissal.
Co-authored-by: CSL <caishilin@zhihu.com>
Co-authored-by: cos <i@cosine.ren>
* fix(PopupPanel): use non-deprecated activate API and guard focus restore
- Replace deprecated activate(options:) with activate()
- Only restore focus when MoePeek is still frontmost, avoiding
pulling focus back if user has already switched away manually
- Clean up property grouping for readability
---------
Co-authored-by: Silas <caishilin@yahoo.com>
Co-authored-by: CSL <caishilin@zhihu.com>1 parent 5db355e commit 709613b
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
83 | 94 | | |
84 | 95 | | |
85 | 96 | | |
| |||
0 commit comments