Skip to content

Commit 434065a

Browse files
author
MarcoFalke
committed
Merge #219: qt: Prevent the main window popup menu
ca5bd1c qt: Prevent the main window popup menu (Hennadii Stepanov) Pull request description: bitcoin/bitcoin#11168 is not fixed by bitcoin/bitcoin#11169 completely, as users are allowed to right click on the menu bar: ![Screenshot from 2021-02-23 14-18-24](https://user-images.githubusercontent.com/32963518/108842753-699eb700-75e2-11eb-92ec-3aff9aa80bd4.png) This PR moves the context menu prohibition from `QToolBar` instance to its parent `BitcoinGUI` instance, which is derived from `QMainWindow`. ACKs for top commit: jarolrod: ACK ca5bd1c, tested on Ubuntu 20.04 Qt 5.12. Confirming that I can replicate the behavior described on `master` and this `PR` fixes it. leonardojobim: tACK ca5bd1c Tree-SHA512: a654ecf7ee35bb271df039be77077c1e1f9514e332587ba8622cea18da6a5b3ae8a7eb421e404ec5993c31a2f4d028e0e456fcc01facdbf61a2bc3b1e8423982
2 parents 56f06a9 + ca5bd1c commit 434065a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/qt/bitcoingui.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
8888
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
8989
}
9090

91+
setContextMenuPolicy(Qt::PreventContextMenu);
92+
9193
#ifdef ENABLE_WALLET
9294
enableWallet = WalletModel::isWalletEnabled();
9395
#endif // ENABLE_WALLET
@@ -544,7 +546,6 @@ void BitcoinGUI::createToolBars()
544546
{
545547
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
546548
appToolBar = toolbar;
547-
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
548549
toolbar->setMovable(false);
549550
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
550551
toolbar->addAction(overviewAction);

0 commit comments

Comments
 (0)