|
|
@@ -249,11 +249,13 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget( |
|
|
|
|
|
|
|
if (c == nullptr && Process::isForegroundProcess())
|
|
|
|
{
|
|
|
|
Desktop& desktop = Desktop::getInstance();
|
|
|
|
|
|
|
|
// getting a bit desperate now: try all desktop comps..
|
|
|
|
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;)
|
|
|
|
if (ApplicationCommandTarget* const target = findTargetForComponent (Desktop::getInstance().getComponent (i)
|
|
|
|
->getPeer()->getLastFocusedSubcomponent()))
|
|
|
|
return target;
|
|
|
|
for (int i = desktop.getNumComponents(); --i >= 0;)
|
|
|
|
if (ComponentPeer* const peer = desktop.getComponent(i)->getPeer())
|
|
|
|
if (ApplicationCommandTarget* const target = findTargetForComponent (peer->getLastFocusedSubcomponent()))
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c != nullptr)
|
|
|
@@ -263,8 +265,8 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget( |
|
|
|
// still be passed up to the top level window anyway, so let's send it to the
|
|
|
|
// content comp.
|
|
|
|
if (ResizableWindow* const resizableWindow = dynamic_cast <ResizableWindow*> (c))
|
|
|
|
if (resizableWindow->getContentComponent() != nullptr)
|
|
|
|
c = resizableWindow->getContentComponent();
|
|
|
|
if (Component* const content = resizableWindow->getContentComponent())
|
|
|
|
c = content;
|
|
|
|
|
|
|
|
if (ApplicationCommandTarget* const target = findTargetForComponent (c))
|
|
|
|
return target;
|
|
|
|