ApplicationCommandManager menus not active - annoyance


I posted this once, in a plugin instance the menu used in the eudio editor (it it's a document window) is greyed out unless some clicking is done on that menu or on some other component (i get a 100% hit rate if i click on the resizing corner component). This was explained as a focus issue.

I traced it down to the ApplicationCommandManager::findDefaultComponentTarget method that returns JUCEApplication::getInstance() that returns 0 since such instance does not exist. I was wondering could we maybe change that static method to include support for plugins ? Or a different way, what can i do in my code to work around the problem, grabbing keyboard focus in the editor constructor isn't helping, should i do that somewhere else, maybe that should be delayed ?



It'd be tricky to change that method to handle plugins, because there isn't a list of all the plugin windows that are open..

One idea would be to call ApplicationCommandManager::setFirstCommandTarget() before opening the menu?


Thanks i will try that.