changeset 664:cfe684675e81

Workaround for disappearing menubar under Ubuntu
author Chris Cannam
date Mon, 01 Sep 2014 16:12:33 +0100
parents 43c61fd6fea4
children 88061103b878
files easyhg.pro src/mainwindow.cpp
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/easyhg.pro	Fri Mar 01 09:20:11 2013 +0000
+++ b/easyhg.pro	Mon Sep 01 16:12:33 2014 +0100
@@ -4,8 +4,8 @@
 TEMPLATE = app
 TARGET = EasyMercurial
 
-#QT += widgets
-#QMAKE_CXXFLAGS += -DQT_DISABLE_DEPRECATED_BEFORE=0x000000
+QT += widgets
+QMAKE_CXXFLAGS += -DQT_DISABLE_DEPRECATED_BEFORE=0x000000
 
 # We use the 10.5 SDK and Carbon for all 32-bit OS/X,
 # and 10.6 with Cocoa for all 64-bit. (Since EasyHg 1.2,
--- a/src/mainwindow.cpp	Fri Mar 01 09:20:11 2013 +0000
+++ b/src/mainwindow.cpp	Mon Sep 01 16:12:33 2014 +0100
@@ -3048,6 +3048,16 @@
 
 void MainWindow::createMenus()
 {
+#ifdef Q_OS_LINUX
+    // In Ubuntu 14.04 the window's menu bar goes missing entirely if
+    // the user is running any desktop environment other than Unity
+    // (in which the faux single-menubar appears). The user has a
+    // workaround, to remove the appmenu-qt5 package, but that is
+    // awkward and the problem is so severe that it merits disabling
+    // the system menubar integration altogether. Like this:
+    menuBar()->setNativeMenuBar(false);
+#endif
+
     m_fileMenu = menuBar()->addMenu(tr("&File"));
 
     m_fileMenu->addAction(m_openAct);