--- .//qtbase/src/plugins/platforms/cocoa/qcocoamenubar.mm.orig	2019-12-13 12:26:06.000000000 -0500
+++ .//qtbase/src/plugins/platforms/cocoa/qcocoamenubar.mm	2019-12-14 13:41:11.000000000 -0500
@@ -79,6 +79,7 @@
     [m_nativeMenu release];
     static_menubars.removeOne(this);
 
+#if 0 //original
     if (!m_window.isNull() && m_window->menubar() == this) {
         m_window->setMenubar(nullptr);
 
@@ -88,6 +89,17 @@
         qDeleteAll(children());
         updateMenuBarImmediately();
     }
+#else //my version
+    if (!m_window.isNull() && m_window->menubar() == this) {
+        m_window->setMenubar(nullptr);
+    }
+
+    // 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();
+#endif
 }
 
 bool QCocoaMenuBar::needsImmediateUpdate()
@@ -252,6 +264,9 @@
     if (qApp->focusWindow())
         return static_cast<QCocoaWindow*>(qApp->focusWindow()->handle());
 
+    // fixme shouldn't this look for another visible toplevel window
+    // and that is active first?
+
     return nullptr;
 }
 
