Skip to content

[Skia] Button background stays painted after a hover when its rest background is fully transparent #26667

Todo

Description

@Kunal22shah

Current behavior 🐛

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.

<Button Content="Hover me"
        Background="Transparent"
        BorderBrush="Transparent">
    <Button.Resources>
        <SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="Red" />
    </Button.Resources>
</Button>
  1. Move the pointer over the button: it turns red.
  2. 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.

Affected platforms 📱💻🖥️

Skia (Windows); other Skia targets not checked.

Activity

  1. added
    kind/bug
    triage/untriaged
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugtriage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions