Skip to content

Commit 0bde86b

Browse files
marysakamaxkatz6
andauthored
Use popupParent as X11 parent window (#14366)
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]>
1 parent 3b1eb33 commit 0bde86b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Avalonia.X11/X11Window.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
142142
defaultWidth = Math.Max(defaultWidth, 300);
143143
defaultHeight = Math.Max(defaultHeight, 200);
144144

145-
_handle = XCreateWindow(_x11.Display, _x11.RootWindow, 10, 10, defaultWidth, defaultHeight, 0,
145+
var parentHandle = popupParent != null ? ((X11Window)popupParent)._handle : _x11.RootWindow;
146+
147+
_handle = XCreateWindow(_x11.Display, parentHandle, 10, 10, defaultWidth, defaultHeight, 0,
146148
depth,
147149
(int)CreateWindowArgs.InputOutput,
148150
visual,

0 commit comments

Comments
 (0)