Open imNel opened 1 year ago
Any updates on this issue?
I have the same problem, does anyone know how to solve it?
@imNel How did you solve this problem?
this issue still not fixed at latest 2.0 rc
This is not an issue to fix IMO, handing focus off to another window upon hiding is tricky. I don't know much about macOS but probably only the OS knows what last focused window was and even if we know that, I don't think macOS allows an app to focus a window from another app (I could be wrong).
In the past and in different frameworks not necessarily tauri, I've seen some people trick the OS into returning focus by minimizing the window before hiding (works well on Windows and Linux, not sure about macOS). If your app consists of only 1 window, I've also seen some people call app.hide()
I will still leave the issue open, in case someone finds a fix.
I found a solution to the issue where appWindow.hide() doesn't un-focus the window. Create an NSPanel window to manage the focus without affecting the current window.
Describe the bug
Running appWindow.hide() doesn't un-focus the window. The default behaviour of cmd+h doesn't have this issue but using .hide() does.
I've tried using setFocus but that only brings the window in focus, not toggle.
Reproduction
This is the code I can use to reproduce the issue:
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response