fix(ui): embed popups to fix ComboBox dropdown placement on X11 HiDPI - #35
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On X11 with HiDPI + GNOME fractional scaling (
Xft.dpi 192→ 2× scale, experimentalx11-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 = trueinProgram.csBuildAvaloniaApp(), 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).Verification
dotnet build -c Debug).390×1008override-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.