Skip to content

Commit

Permalink
Use popupParent as X11 parent window (#14366)
Browse files Browse the repository at this point in the history
Previously, the popupParent was ignored when present causing popups to
have the X root window as its parent.

This cause issues on gamescope (SteamOS session compositor) where that window would end up behind the
main window.

Signed-off-by: Mary Guillemard <[email protected]>
Co-authored-by: Max Katz <[email protected]>
  • Loading branch information
marysaka and maxkatz6 committed Feb 8, 2024
1 parent 473b21b commit 567561e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Avalonia.X11/X11Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
defaultWidth = Math.Max(defaultWidth, 300);
defaultHeight = Math.Max(defaultHeight, 200);

_handle = XCreateWindow(_x11.Display, _x11.RootWindow, 10, 10, defaultWidth, defaultHeight, 0,
var parentHandle = popupParent != null ? ((X11Window)popupParent)._handle : _x11.RootWindow;

_handle = XCreateWindow(_x11.Display, parentHandle, 10, 10, defaultWidth, defaultHeight, 0,
depth,
(int)CreateWindowArgs.InputOutput,
visual,
Expand Down

0 comments on commit 567561e

Please sign in to comment.