currently I'm using activate and makeKeyAndOrderFront to "show" and focus a TextEditor on my NSPanel when I pressing a hotkey. However this steals the input focus from other apps. How should I go about also maintaining the input focus from background apps so when close the nspanel, the key focus resumes on the background app?
activate(ignoringOtherApps: true) panel?.makeKeyAndOrderFront(panel)
I tried just calling makeKeyAndOrderFront but my TextEditor won't focus for some reason. There are other apps like Raycast that does this perfectly, as seen from the screenshot below.
my NSPanel is pretty basic https://pastebin.com/3QtQ1xe4
Any help would be much appreciated!
I tried removing activate(ignoringOtherApps: true) but that doesn't focus the TextEditor on my NSPanel.