Qt5: fixed TMainMenu submenus positioning under Wayland. issue #40602

This commit is contained in:
Željan Rikalo 2023-11-17 23:03:26 +01:00
parent 4b6c4e06e3
commit 4b1a81ac7b

View File

@ -16081,6 +16081,14 @@ begin
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
else
Parent := nil;
{$IFDEF HASX11}
// issue #40602
if IsWayland and Assigned(FMenuItem) and FMenuItem.HasParent and not FMenuItem.Parent.HasParent and
(FMenuItem.GetParentMenu is TMainMenu) then
Parent := TQtMainWindow(Application.MainForm.Handle).MenuBarNeeded.Widget;
{$ENDIF}
Result := QMenu_create(Parent);
FDeleteLater := True;
FActionHandle := nil;