sointu icon indicating copy to clipboard operation
sointu copied to clipboard

tool tips can stay around

Open wayfu opened this issue 1 year ago • 6 comments

image

wayfu avatar Aug 21 '24 18:08 wayfu

These are from the gioui GUI library, specifically from extras (x) package under it: https://pkg.go.dev/gioui.org/x/component#Tooltip

I can try to update to latest version of gioui to see if this fixes the issue, but upgrading gioui is always a pain as they break their APi constantly as they are still not at v1.0.

If not, I may need to contact the maintainer of the x package to fix this.

vsariola avatar Aug 22 '24 05:08 vsariola

This does not seem to be fixed by latest gioui, I need to ask the maintainers of gioui what to do about it.

vsariola avatar Aug 22 '24 05:08 vsariola

ah, if it's not an easy fix for you, no need to prioritize this one - it's purely cosmetic. thank you for looking into it

wayfu avatar Aug 22 '24 06:08 wayfu

There was no need to look for it; I already knew about it but never got around opening an issue here or gioui issue tracker, as the issue was quite minor one and it's not in Sointu codebase. But it's good to have this issue here as a reminder; hopefully there's a way to fix it someday.

vsariola avatar Aug 22 '24 09:08 vsariola

Gioui widgets simply do not get pointer.Leave events when the pointer leaves the window completely. Unless they change gioui internally, there's no way to rely on this. The problem seems to be that every platform (windows, macos etc.) you need a different way to detect when cursor leaves window, so this is not impossible but not a zero-amount of work either.

It might easiest just to make the tooltips have some upper time limit and then fade them away after that, so they don't hang around forever. This also is not supported by the tooltip package, but at least needs no platform-specific code, so might be easier to make.

vsariola avatar Sep 06 '24 18:09 vsariola

So just to clarify: the reason the tooltips don't leave is that the pointer quickly moves out of the window, and the tooltip widget does not get pointer.Leave event. This event is what triggers the hiding of the tooltip.

vsariola avatar Sep 06 '24 18:09 vsariola

Fixed, by making own implementation of the tip area logic, and putting 5 s delay to hide the tooltip, no matter what. This ensures that even if the pointer left the window without triggering a pointer.Leave event, the tooltip does not stay around indefinitely.

vsariola avatar Jun 23 '25 15:06 vsariola

Not fixed, there seems to still be some case when the tool tips can stay behind.

vsariola avatar Jun 25 '25 09:06 vsariola