From e59d3a339fcba0d17fd70df5690d358d1da315ac Mon Sep 17 00:00:00 2001 From: Kenneth Chew Date: Sat, 16 Apr 2022 02:07:29 -0400 Subject: Close the current window instead of the main window from the menu bar Systems with native menu bars show the same menu bar for all child windows. As a result, you cannot assume that the menu bar's parent (the `MainWindow`) will be the window in focus. --- launcher/ui/MainWindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'launcher/ui') diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 90af763a..1c694484 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -615,8 +615,7 @@ public: closeAct = new QAction(tr("Close &Window"), MainWindow); closeAct->setShortcut(QKeySequence::Close); closeAct->setStatusTip(tr("Close the current window")); - // FIXME: currently this always closes the main window, even if it is not currently the window in focus - connect(closeAct, &QAction::triggered, MainWindow, &MainWindow::close); + connect(closeAct, &QAction::triggered, APPLICATION, &Application::closeCurrentWindow); undoAct = new QAction(tr("&Undo"), MainWindow); undoAct->setShortcuts(QKeySequence::Undo); -- cgit