Skip to content

Avalonia menu hover state remains active when pointer enters native WebView #52

Description

@jochenwezel

Context

During manual testing of the Avalonia 12 migration in #51, a menu item remains visually hovered after the pointer leaves the menu and moves into the embedded browser area.

The first observation was made with:

  • GuacamoleClient Avalonia dev preview
  • Avalonia 12.0.5
  • Avalonia.Controls.WebView 12.0.1
  • Ubuntu 24.04.4 LTS
  • GNOME Wayland session with the GTK/X11 WebView running through XWayland

Steps to reproduce

  1. Start the Avalonia client with a configured Guacamole server.
  2. Move the pointer over an item in the top menu.
  3. Move the pointer directly from the menu into the native WebView area.
  4. Observe the menu item background and foreground colors.

Actual behavior

The menu item keeps its hover colors after the pointer has left it. The :pointerover visual state is not reset reliably.

Expected behavior

The menu item immediately returns to its normal colors when the pointer leaves it, including when the pointer enters the native WebView.

Technical notes

This may be caused by the embedded native control intercepting pointer events before Avalonia receives PointerExited. Avalonia tracks the general limitation in AvaloniaUI/Avalonia#5256.

The current application styles use regular MenuItem:pointerover selectors, so the first investigation should distinguish an application style issue from a NativeControlHost pointer-transition issue.

Related migration ticket: #51

Test checklist

  • Reproduce with Windows and WebView2.
  • Reproduce with Linux under a native X11 session.
  • Reproduce with Linux under Wayland/XWayland.
  • Reproduce with macOS and WKWebView.
  • Test moving from the menu into the WebView without opening a submenu.
  • Test moving from an open menu or submenu into the WebView.
  • Test moving from the menu outside the application window.
  • Test windowed and full-screen modes.
  • Determine whether Avalonia loses PointerExited at the native-control boundary.
  • Implement a platform-safe fix or workaround.
  • Verify that normal menu selection and keyboard navigation remain unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtesting requiredManual verification is required before closing.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions