Dismiss PopupMenu when focus changes

yes, the bounds would be constrained by the parent comp.
otherwise, regarding the dismiss when the window is moving I used a code like that in the past (a bit hacky, but that should work) :

void timerCallback() override
{
    if (topComp == nullptr)
        topComp = pluginEditor->getTopLevelComponent();

    if (topComp != nullptr)
    {
        if (ComponentPeer* peer = topComp->getPeer())
        {
            const Point<float> point = peer->localToGlobal (Point<float>());

            if (point != previousPoint)
            {
                 previousPoint = point;
                 PopupMenu::dismissAllActiveMenus();
            }
        }
    }
}

I really like your plugins btw.