vsariola / sointu

Fork of 4klang that can target 386, amd64 and WebAssembly. Tools run on Windows, Mac & Linux
MIT License
262 stars 17 forks source link

tool tips can stay around #141

Open wayfu opened 3 months ago

wayfu commented 3 months ago

image

vsariola commented 3 months ago

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 commented 3 months ago

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

wayfu commented 3 months ago

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

vsariola commented 3 months ago

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 commented 2 months ago

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 commented 2 months ago

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.