Skip to content

Commit c08fe99

Browse files
committed
gui: macOS, make appMenuBar part of the main app window
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 may have served a purpose in earlier versions when it didn't contain actions that directly open specific screens within the main application window. However, at present, all the actions within the appMenuBar lead to the opening of screens within the main app window. So, the absence of a main app window makes these actions essentially pointless.
1 parent e14cc8f commit c08fe99

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/qt/bitcoingui.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ BitcoinGUI::~BitcoinGUI()
239239
trayIcon->hide();
240240
#ifdef Q_OS_MACOS
241241
delete m_app_nap_inhibitor;
242-
delete appMenuBar;
243242
MacDockIconHandler::cleanup();
244243
#endif
245244

@@ -470,13 +469,8 @@ void BitcoinGUI::createActions()
470469

471470
void BitcoinGUI::createMenuBar()
472471
{
473-
#ifdef Q_OS_MACOS
474-
// Create a decoupled menu bar on Mac which stays even if the window is closed
475-
appMenuBar = new QMenuBar();
476-
#else
477472
// Get the main window's menu bar on other platforms
478473
appMenuBar = menuBar();
479-
#endif
480474

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

0 commit comments

Comments
 (0)