From 5bb6c4d9e4ed5f5585b2aa04e08c001e61c31c95 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 14 Feb 2017 16:01:14 +0100 Subject: [PATCH] Check for isVisible() instead of isNativeMenuBar() to make global menu hack work with appmenu-qt5, follow-up fix for #271 --- src/gui/MainWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 288d8224e..879dd3c58 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -745,7 +745,8 @@ void MainWindow::toggleWindow() // re-register global D-Bus menu (needed on Ubuntu with Unity) // see https://github.com/keepassxreboot/keepassxc/issues/271 // and https://bugreports.qt.io/browse/QTBUG-58723 - if (m_ui->menubar->isNativeMenuBar()) { + // check for !isVisible(), because isNativeMenuBar() does not work with appmenu-qt5 + if (!m_ui->menubar->isVisible()) { QDBusMessage msg = QDBusMessage::createMethodCall( "com.canonical.AppMenu.Registrar", "/com/canonical/AppMenu/Registrar",