You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Skia] Button background stays painted after a hover when its rest background is fully transparent #26667
A Button whose rest Background is fully transparent keeps its hover fill on screen after the pointer leaves. Sometimes only part of the fill stays (for example, the top half).
The control's state is correct. After the pointer leaves:
the visual state is Normal;
ContentPresenter.Background is the transparent brush;
a RenderTargetBitmap of the button is transparent.
Only the on-screen frame is wrong, so the last frame of the brush transition is never painted.
It does not happen when:
the rest background has any alpha, even #01FFFFFF;
the template's ContentPresenter.BackgroundTransition is cleared;
the default button is used (its rest fill is ButtonBackground, which is not transparent).
Expected behavior 🎯
As on WinUI: after the pointer leaves, the button returns to its transparent rest background.
How to reproduce it (as minimally and precisely as possible) 🔬
Stock Fluent styles; no third-party theme is involved.
Move the pointer away: the button stays red, or partly red, until something else invalidates that area.
The same happens with VisualStateManager.GoToState(button, "PointerOver", true) followed by GoToState(button, "Normal", true). Capturing the window shows the stuck fill, while RenderTargetBitmap does not.
Possibly related (from reading the code, not confirmed):
BorderHelper.skia.cs: when a new transition is registered while one is active, the old one is reactivated.
Compositor.skia.cs: the expired-transition cleanup loop calls Remove(current) and then reads current.Next.
Workaround 🛠️
Use a near-transparent rest background (#01FFFFFF), or set the template's ContentPresenter.BackgroundTransition to null.
Works on UWP/WinUI 🤷
Yes
Environment 📦
Uno.Sdk.Private 7.1.0-dev.477, Skia desktop on Windows 11. Found through the Uno.Themes Fluent sample (unoplatform/Uno.Themes#1695), where the text and icon buttons have a transparent rest background.
Activity