You can create your panel like this:
<panel
id="yourPanel"
type="arrow"
noautohide="true"
level="parent">
</panel>
Explanation:
level = "parent" means the panel is shown just above the window the panel is in, but behind other windows above it.
noautohide = "true" means the panel will only be closed when the hidePopup
method is called.
With these two combined, you get the behavior you're looking for.
For reference see mdn panel page