Skip to content

Commit d12568e

Browse files
author
MarcoFalke
committed
Merge #18549: qt: Fix Window -> Minimize menu item
56fe839 qt: Fix Window -> Minimize menu item (Hennadii Stepanov) Pull request description: Now Window -> Minimize menu item is broken on Linux. Steps to reproduce: 1. start `bitcoin-qt` 2. activate Window -> Minimize menu item with a keyboard (not by a shortcut) or a mouse **Expected behavior** The main window gets minimized. **Actual behavior** The main window still unchanged. Even worse: the menu widget becomes a separate window: ![Screenshot from 2020-04-07 00-32-02](https://user-images.githubusercontent.com/32963518/78608129-ffb1dd80-7868-11ea-8e73-62ecc140ac1f.png) This PR does not touch the macOS specific code as `qApp->focusWindow()` seems work on macOS flawlessly. ACKs for top commit: promag: Tested ACK 56fe839 on bionic with qt 5.9.5. Tree-SHA512: 3582e44ba181d859f5994b9cddc6ce1b60aa1db520a31dd3a0684336c79d558d7410ce7a1ab5b0860c6431b54d8acc3aa16e399717b4c70839861e6b6c4290c0
2 parents abc145c + 56fe839 commit d12568e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ void BitcoinGUI::createMenuBar()
456456
QAction* minimize_action = window_menu->addAction(tr("Minimize"));
457457
minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
458458
connect(minimize_action, &QAction::triggered, [] {
459-
qApp->focusWindow()->showMinimized();
459+
QApplication::activeWindow()->showMinimized();
460460
});
461461
connect(qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) {
462462
minimize_action->setEnabled(window != nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);

0 commit comments

Comments
 (0)