Windows always on top problem


My VST-hosting plugin shows the hosted VST in an always-on-top window. The problem is that when I press the quit button on the main host (for instance Ableton or FLStudio) while the always-on-top window of the hosted plugin is open, the main host will show the “Want to save your work?” modal dialog BEHIND the always-on-top window, which leads to a hang, because the user cannot press any button since they are not visible.

The correct behaviour should ofcourse be that the modal window comes in front of the always-on-top window.

Why is that and what can I do about it?


Well, I can’t think of anything you could do about it - if you ask a window to stay on top, that’s what it does… In juce when I open a dialog box I check whether there are any always-on-top windows and if so, make the dialog box always-on-top too. But there’s no way to make the host do that.


Actually, I just found out that when you tell this window that its parent is the host’s main window, then it works - the last instantiated modal or always on top window will then go in front of it.

Well it’s even a bit more complicated. In fact, FLStudio’s main window is 0x0 pixels big, and so you have to take that one’s first child window. It’s all strange.