Alright, new problem >_<
Now it works, but I noticed 2 things:
-
The tray icon does not respond every single time it is clicked, in fact it precisely responds 50% of the time. Testing other mac apps, they do not have that problem. Checking in the code, it seems mouseDown() is only called 1 out of 3 times:
- 1st click: mouseDown() is called, menu appears
- 2nd click: menu disappears, mouseDown() is not called (that one makes sense)
- 3rd click: nothing happens, mouseDown() is not called (should be same as 1st)
- 4th click: same as 1st
- and so on
-
When exiting with Cmd+Q or with the Apple menu on the top left, everything is fine. But when exiting with the tray icon, the program hangs until it is clicked again. The exit callback calls
JUCEApplication::getInstance()->systemRequestedQuit();, which enda the message dispatch loop by callingshutdownNSApp();atjuce_MessageManager_mac.mm:352. But then the program is stuck in[NSApp run];
ofrunDispatchLoop()(same file at line 335)
The two issues are clearly related, because the second does not happen everytime, depending on whether we are on the click that does not work or not.
EDIT: since this is a new issue I have made a new topic about it → Message loop hanging when using SystemTrayIconComponent::showDropdownMenu
(there is a test project included as well)
