From dccf5a5ae7cda289be1796f145742ccfe478f086 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 14 Jun 2018 15:04:52 +0200 Subject: [PATCH] Set parents for menus in the main menu bar Shouldn't be necessary because the MenuActionContainer takes care of deletion if it wasn't deleted before, but works around issues with placing menu popups with Qt Wayland (QTBUG-68636) Task-number: QTCREATORBUG-20516 Change-Id: Ib1d393abc78b145905429e64f8bf7541af75bdad Reviewed-by: Johan Helsing Reviewed-by: Robert Loehning --- src/plugins/coreplugin/actionmanager/actioncontainer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index c1ca6e7970b..e1374ac73af 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -403,6 +403,7 @@ void MenuActionContainer::insertAction(QAction *before, QAction *action) void MenuActionContainer::insertMenu(QAction *before, QMenu *menu) { + menu->setParent(m_menu, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636) m_menu->insertMenu(before, menu); } @@ -509,6 +510,7 @@ void MenuBarActionContainer::insertAction(QAction *before, QAction *action) void MenuBarActionContainer::insertMenu(QAction *before, QMenu *menu) { + menu->setParent(m_menuBar, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636) m_menuBar->insertMenu(before, menu); }