Skip to content

fix(ui): embed popups to fix ComboBox dropdown placement on X11 HiDPI - #35

Merged
obazna merged 1 commit into
masterfrom
fix/x11-overlay-popups-hidpi
Sep 5, 2026
Merged

fix(ui): embed popups to fix ComboBox dropdown placement on X11 HiDPI#35
obazna merged 1 commit into
masterfrom
fix/x11-overlay-popups-hidpi

Conversation

@obazna

@obazna obazna commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

On X11 with HiDPI + GNOME fractional scaling (Xft.dpi 192 → 2× scale, experimental x11-randr-fractional-scaling + scale-monitor-framebuffer), ComboBox dropdowns open in the wrong place. The FlightData → Actions → Set Mode flight-mode list flips up over the HUD, and intermittently lands jammed in the top-left screen corner, clipped, detached from its combo.

Cause

Popups default to separate X11 override-redirect windows positioned by Avalonia's ManagedPopupPositioner. Under fractional scaling that positioner miscomputes placement (wrong flip / stale anchor translation), so the dropdown detaches from its combo. The controls are plain <ComboBox> (e.g. GCSViews/FlightDataView.axaml) with no custom placement — this is a platform-positioner issue, not a XAML one.

Fix

Set X11PlatformOptions.OverlayPopups = true in Program.cs BuildAvaloniaApp(), so popups render inside the top-level window's overlay layer and bypass the X11 positioner entirely. One-line, app-wide (covers combobox dropdowns, menus, flyouts, tooltips).

AppBuilder.Configure<App>()
    .UsePlatformDetect()
    .With(new X11PlatformOptions { OverlayPopups = true })
    .WithInterFont()
    .LogToTrace();

Verification

  • Build: 0 warnings / 0 errors (dotnet build -c Debug).
  • Launched on the affected 5120×2880 / 2× display; opened Actions dropdowns — they now render in-window, anchored directly below the combo, correctly aligned. Confirmed via X11 window-tree diff that no separate popup window is created while the dropdown is open (before: a 390×1008 override-redirect window appeared, mispositioned).

Trade-off

Overlay popups are clipped to the window bounds. The main window is effectively full-screen, so this is a non-issue here; small dropdowns stay glued to their combo and scroll when tall.

Enable X11PlatformOptions.OverlayPopups so ComboBox dropdowns and other
popups render inside the top-level window instead of as separate X11
override-redirect windows. Avalonia's X11 ManagedPopupPositioner
mislocates popups under HiDPI + GNOME fractional scaling: the FlightData
Actions "Set Mode" list flips up over the HUD and intermittently jumps to
the top-left screen corner, clipped. Overlay popups bypass that positioner.

Verified on the affected display: dropdowns render in-window anchored to
the combo, with no separate X11 popup window created. Build 0/0.

Claude-Session: https://claude.ai/code/session_01Rb5qAZYPxTr2dpKx34q25d
@obazna
obazna merged commit 512d9f7 into master Sep 5, 2026
6 checks passed
@obazna
obazna deleted the fix/x11-overlay-popups-hidpi branch September 5, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant