Skip to content

Commit

Permalink
gui: macOS, make appMenuBar part of the main app window
Browse files Browse the repository at this point in the history
By moving the appMenuBar destruction responsibility to the QT
framework, we ensure the disconnection of the submenus signals
prior to the destruction of the main app window.

The standalone menu bar probably made sense on early versions when
it wasn't containing actions that open specific screens within the
main app window.
Right now, all the actions within the appMenuBar open screens in
the main app window, so the lack of main app window makes them
useless.
  • Loading branch information
furszy committed Sep 12, 2023
1 parent e14cc8f commit 3d589b5
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ BitcoinGUI::~BitcoinGUI()
trayIcon->hide();
#ifdef Q_OS_MACOS
delete m_app_nap_inhibitor;
delete appMenuBar;
MacDockIconHandler::cleanup();
#endif

Expand Down Expand Up @@ -470,13 +469,8 @@ void BitcoinGUI::createActions()

void BitcoinGUI::createMenuBar()
{
#ifdef Q_OS_MACOS
// Create a decoupled menu bar on Mac which stays even if the window is closed
appMenuBar = new QMenuBar();
#else
// Get the main window's menu bar on other platforms
appMenuBar = menuBar();
#endif

// Configure the menus
QMenu *file = appMenuBar->addMenu(tr("&File"));
Expand Down

0 comments on commit 3d589b5

Please sign in to comment.