Ui does not properly handle mouse-out from the ui itself.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
When the mouse leaves the ui, the mouse-out event is not processed.
This can be seen here:
https://github.com/stride3d/stride/blob/master/sources/engine/Stride.UI/Rendering/UI/UIRenderFeature.Picking.cs#L249
Basically if the mouse is not within the bounds, the mouse is not handled. While this is correct theoretically, it will also skip invoking the mouse out event for the currently hovered element, leaving it in the hovered state.
This can be seen here:

A hacked workaround is this:
protected override bool BeginDraw()
{
this.uiRenderFeature ??= this.SceneSystem.GraphicsCompositor.RenderFeatures.OfType<UIRenderFeature>().FirstOrDefault();
this.uiElementUnderMouseCursor = this.uiRenderFeature?.UIElementUnderMouseCursor;
return base.BeginDraw();
}
protected override void EndDraw(bool present)
{
if (this.uiElementUnderMouseCursor != null && this.uiRenderFeature?.UIElementUnderMouseCursor == null)
this.uiElementUnderMouseCursor?.GetType().GetProperty("MouseOverState")?.SetValue(this.uiElementUnderMouseCursor, MouseOverState.MouseOverNone);
base.EndDraw(present);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at sources/engine/Stride.UI/Rendering/UI/UIRenderFeature.Picking.cs#L249 and trace the bounds check and current hovered-element handling. Reproduce the mouse leaving the UI using the linked animation as a guide. Done means the previously hovered element receives its mouse-out event and no longer remains hovered when the pointer is outside the UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100