diff --git a/src/widgets/mainwindow.cpp b/src/widgets/mainwindow.cpp index 14f4b007..c41608ad 100644 --- a/src/widgets/mainwindow.cpp +++ b/src/widgets/mainwindow.cpp @@ -349,9 +349,6 @@ void MainWindow::setupMenuBar() this->showNormal(); }); #ifdef Q_OS_OSX - // Remove the file menu, because macOS will add an "app menu". - _ui->menu_File->menuAction()->setVisible(false); - // Leave the three Windows actions enabled and visible. #else // Set default shortcut for showing the help. diff --git a/tests/mainwindow/test-mainwindow.cpp b/tests/mainwindow/test-mainwindow.cpp index 4002ebab..76a933f7 100644 --- a/tests/mainwindow/test-mainwindow.cpp +++ b/tests/mainwindow/test-mainwindow.cpp @@ -66,6 +66,7 @@ private slots: void about_window_menubar(); void stoptasksdialog_nonquit(); void quit_simple(); + void quit_keyboard(); void quit_tasks(); void tab_navigation(); void other_navigation(); @@ -208,6 +209,26 @@ void TestMainWindow::quit_simple() delete mainwindow; } +void TestMainWindow::quit_keyboard() +{ + IF_MACOS_PRE_5_15_SKIP; + IF_NOT_VISUAL { QSKIP("can't check keyboard with --platform=offscreen"); } + + MainWindow *mainwindow = new MainWindow(); + + VISUAL_INIT(mainwindow); + + // We should be visible. + QVERIFY(mainwindow->isVisible() == true); + VISUAL_WAIT; + + // Try to close the window with a keyboard shortcut + QTest::keyClick(mainwindow, Qt::Key_Q, Qt::ControlModifier); + QVERIFY(mainwindow->isVisible() == false); + + delete mainwindow; +} + void TestMainWindow::quit_tasks() { IF_MACOS_PRE_5_15_SKIP;