TooltipWindow new click behaviour?

Since moving from JUCE 5 to 6.1.4 the tooltip seems to invalidate itself when any ui component is clicked. Looks like all mouseDowns are also forwarded to the tooltipWindow, which sets a flag to not show the tooltip.

I presume this was a deliberate change - but what was the reason for it?

I ask because we’re using an off-label implementation where a right-click on our Component allows the user to see the tooltip on-demand. With this new JUCE tooltipWindow the tooltip is invalidated immediately so user doesn’t see it till they move the mouse.

Yes, we should probably trigger the tooltip display manually with displayTip() but this means making the tooltipWindow available to all GUI elements. Do people ever do this with a singleton?

This was to make the tooltips behave a bit more like other apps that I tested. Previously, the tooltip would be immediately re-shown after clicking, which can be annoying if the click causes another part of the window to update/redraw. The redrawn part can end up partially obscured by the tooltip, which normally isn’t very helpful.

Additionally, if a user wants to read the tooltip, they’ll normally wait until the tooltip has displayed, and then click the control once they’re certain it will have the desired effect. Showing the tooltip immediately after clicking isn’t as useful because the user is probably aware of the consequences once they’ve already clicked the button.

I don’t really understand how this works. If you’re not currently calling displayTip, how are you forcing the tooltip to display on right-click?

Fair enough - seems a reasonable decision.

My trick was to keep a flag in my UI component which determined whether to show a tip or not. if not, the getTooltip() function returns an empty string which the tooltipWindow interprets as meaning “no tip”. Your tooltipClient getTooltip() is repeated called so we can allow a user to right click and make the tip appear.

I realise it’s a bit of a hack so I’ll work around the new behaviour.