Disable right-click menu on main window

Before, right-clicking on the toolbar would allow toggling all dock widgets, including the debugger ones even when they are disabled. (See https://doc.qt.io/qt-5/qmainwindow.html#createPopupMenu for this behavior, and https://bugs.dolphin-emu.org/issues/13306 for an example of where it caused issues.)
This commit is contained in:
Pokechu22 2023-07-23 15:13:47 -07:00 committed by Nayla Hanegan
parent 0f33e71912
commit 6617f8ddcf
No known key found for this signature in database
GPG key ID: 3075216CED0DB01D
2 changed files with 9 additions and 0 deletions

View file

@ -1764,6 +1764,13 @@ bool MainWindow::eventFilter(QObject* object, QEvent* event)
return false;
}
QMenu* MainWindow::createPopupMenu()
{
// Disable the default popup menu as it exposes the debugger UI even when the debugger UI is
// disabled, which can lead to user confusion (see e.g. https://bugs.dolphin-emu.org/issues/13306)
return nullptr;
}
void MainWindow::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasUrls() && event->mimeData()->urls().size() == 1)