macOS menu bar after hiding window
-
Hi.
In my app I have QSystemTrayIcon with "show" and "hide" actions that call QWidget::show() and QWidget::hide() on app's window. The problem is that on macOS after window is hidden the top menu bar still shows menu for my app and it goes away only after I click somewhere (this also happens after I close window via system close button in title bar since I don't destroy window when it's closed. It can be shown again via QSytemTrayIcon menu's "show" action). How to make menu bar switch to the previous app when my app's window is hidden?
-
@equeim Hi,
One possible way could be to activate Finder. See this stack overflow answer.
-
-
@SGaist said in macOS menu bar after hiding window:
One possible way could be to activate Finder. See this stack overflow answer.
That's not exactly what I need since I want to activate previously active app, not Finder.
Calling NSApp.hide seems to work though.
@mpergand said in macOS menu bar after hiding window:
There is a solution by calling NSApp.hide() on Cocoa, but it's a little bit tricky...
What's the tricky part? I don't see any issues at the first glance.