mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Fixes bitcoin#26490 by preventing notifications
MacOS 13 sends a window focus change notification after the main
window has been destroyed but before the QTApplication has been
destroyed. This results in the menu bar receiving a notification
despite it no longer existing. The solution is to pass the main
window as context when subscribing to the notifications. Qt
automatically unsubscribes to notifications if the sender OR
context is destroyed.
Github-Pull: bitcoin-core/gui#680
Rebased-From: 8a5014cd8a
(cherry picked from commit 272fa2530493b13e4bf7c978e9768162f10ddf7f)
This commit is contained in:
parent
a12aceedf7
commit
7b99ac7a69
1 changed files with 2 additions and 2 deletions
|
|
@ -483,7 +483,7 @@ void BitcoinGUI::createMenuBar()
|
|||
connect(minimize_action, &QAction::triggered, [] {
|
||||
QApplication::activeWindow()->showMinimized();
|
||||
});
|
||||
connect(qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) {
|
||||
connect(qApp, &QApplication::focusWindowChanged, this, [minimize_action] (QWindow* window) {
|
||||
minimize_action->setEnabled(window != nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);
|
||||
});
|
||||
|
||||
|
|
@ -498,7 +498,7 @@ void BitcoinGUI::createMenuBar()
|
|||
}
|
||||
});
|
||||
|
||||
connect(qApp, &QApplication::focusWindowChanged, [zoom_action] (QWindow* window) {
|
||||
connect(qApp, &QApplication::focusWindowChanged, this, [zoom_action] (QWindow* window) {
|
||||
zoom_action->setEnabled(window != nullptr);
|
||||
});
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue