mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-29 22:29:27 +02:00
Qt5: rewritten fix for issue #40602.
This commit is contained in:
parent
4b1a81ac7b
commit
44b898cc32
@ -16073,6 +16073,9 @@ function TQtMenu.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||
var
|
||||
AGroup: TQtActionGroup;
|
||||
Parent: QWidgetH;
|
||||
{$IFDEF HASX11}
|
||||
AForm: TCustomForm;
|
||||
{$ENDIF}
|
||||
begin
|
||||
FTrackButton := QtNoButton;
|
||||
FLastTick := 0;
|
||||
@ -16085,8 +16088,11 @@ begin
|
||||
{$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;
|
||||
(FMenuItem.GetParentMenu is TMainMenu) and (TMainMenu(FMenuItem.GetParentMenu).Parent is TCustomForm) then
|
||||
begin
|
||||
AForm := TCustomForm(TMainMenu(FMenuItem.GetParentMenu).Parent);
|
||||
Parent := TQtMainWindow(AForm.Handle).MenuBarNeeded.Widget;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
Result := QMenu_create(Parent);
|
||||
|
Loading…
Reference in New Issue
Block a user