Stuck tooltips bug (also with AudioPluginDemo)

In another thread on the forum (related to plugin GUI scaling) someone pointed out that you can simply add a tooltip as a member variable in your editor class like so:

TooltipWindow tooltipWindow{this};

However, when I do that, I ran into a strange issue when 2 instances of the plugin’s editor are visible. It’s not a critical issue at all, more like a GUI annoyance, and it seems to indicate that even though each editor has its own separate TooltipWindow, they somehow are connected:

  • make tooltip show up in 1 instance of the plugin
  • quickly move to another instance of the same plugin
  • make tooltip show up in that other instance of the plugin

Result:
The tooltip in the 1st plugin somehow remains on the screen.
When you eventually move the mouse outside of 2nd plugin instance’s drawable area, both tooltips disappear (also the “stuck” one of the 1st instance).

This can easily be reproduced with the AudioPluginDemo (just add that line mentioned above + call setTooltip on one of the sliders):
double tooltips

I observed this for VST, AAX (in my plugin) and VST3 (in the AudioPluginDemo) on Windows 10, using latest JUCE master 6.1.2.

Background:
In my current code, I was not setting the parent component of the TooltipWindow, which then adds it to the desktop (tooltip text extends outside the plugin editor area on to the desktop), but had some issues with that when using multiple screens with different scaling settings, so I was trying to use this now.