File do-not-force-menubar-to-be-shown-when-registrar-is-deleted.diff of Package appmenu-qt

=== modified file 'src/appmenuplatformmenubar.cpp'
--- src/appmenuplatformmenubar.cpp	2013-01-14 15:53:32 +0000
+++ src/appmenuplatformmenubar.cpp	2013-01-17 12:53:26 +0000
@@ -92,6 +92,7 @@
 {
     m_nativeMenuBar = NMB_Auto;
     m_altPressed = false;
+    m_wasVisibleMenuBar = true;
     m_menuBar = _menuBar;
 
     static int menuBarId = 1;
@@ -253,14 +254,17 @@
         destroyMenuBar();
         QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
         m_menuBar->updateGeometry();
-        m_menuBar->setVisible(false);
-        m_menuBar->setVisible(true);
+        if (m_wasVisibleMenuBar) {
+            m_menuBar->setVisible(false);
+            m_menuBar->setVisible(true);
+        }
         return;
     }
 
     // We reach this point if there is a registrar
     QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
     m_menuBar->updateGeometry();
+    m_wasVisibleMenuBar = m_menuBar->isVisible();
     m_menuBar->setVisible(true);
     m_menuBar->setVisible(false);
     delete m_adapter;

=== modified file 'src/appmenuplatformmenubar.h'
--- src/appmenuplatformmenubar.h	2012-04-04 15:51:10 +0000
+++ src/appmenuplatformmenubar.h	2013-01-14 10:44:22 +0000
@@ -56,6 +56,7 @@
 
 private:
     QMenuBar* m_menuBar;
+    bool m_wasVisibleMenuBar;
     MenuBarAdapter* m_adapter;
     enum NativeMenuBar {
         NMB_DisabledByEnv,