From 93500422d120d1090e60f6d1c0ad75fe30d4e806 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 5 Feb 2014 09:15:28 +0100 Subject: Delete the children before updating the Cocoa menubar When the Cocoa menubar is updated then it ensures that the merged native menu items are visible if appropriate. However when the old menubar is deleted then it causes the merged native items to be hidden. Therefore we ensure the children are deleted first which causes the native items to be hidden and then update the menubar so that they can be correctly visible if they should be. Change-Id: I426864a5d2ec1f34c03290ac66371b12bf77cc00 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenubar.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 5a8664747e..7335deb800 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -79,6 +79,10 @@ QCocoaMenuBar::~QCocoaMenuBar() if (m_window && m_window->menubar() == this) { m_window->setMenubar(0); + // Delete the children first so they do not cause + // the native menu items to be hidden after + // the menu bar was updated + qDeleteAll(children()); updateMenuBarImmediately(); } } -- cgit v1.2.3