What could be causing popup menus in an edior plugin to be displaying even when they shoulnd't be visible?

Godot Version

4.7

Question

I’ve created a Godot editor plugin that among other things is automatically generating PopupMenu objects to be the content for a Menubar.

I’ve noticed for a while that this causes what looks like outlines of menus to popup on the upper left corner of my first monitor whenever I load my plugin, but because they then disappear almost immediately I ignored them.

Then someone recently filed a bug that when the editor is set to have Single Window Mode enabled, then they’re much more annoying. They pop up over the top left corner of the Godot Editor when Godot open with my project or whenever I click anywhere inside the Scene panel . It says open until I open another menu dropdown somewhere else and then close it.

I thought this might be some bug in how the Godot Editor handles menus. I tried creating some dummy projects to try and replicate this, but they seem to be behaving properly, even when I generate drop down menus on the fly.

Any idea what could be causing this weird popup menu behaviour? This is the bug report which has a video of it in action:

Popup should be invisible by default and use the Window.popup_*() methods to make them visible. Don’t manually toggle their visibility because they will break.

It’s explained in the documentation:

Note: Popup is invisible by default. To make it visible, call one of the popup_* methods from Window on the node, such as Window.popup_centered_clamped().