Commit 48ecda47 authored by Derek Christ's avatar Derek Christ Committed by Nate Graham
Browse files

Fix shift-action modifier in context menu

Before this patch, the shift-action modifier in context menus did not
work when a sub-context menu is open, that does not have the main
context menu as its parent.
The new fix installs an event filter on QApplication whenever a new
context menu is opened to make the context menu aware of shift-presses
even when a sub-context menu is in focus.

BUG: 425997
FIXED-IN: 5.22
parent 6def77f5
......@@ -1889,6 +1889,7 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
// Used to monitor Shift modifier usage while the menu is open, to
// swap the Trash and Delete actions.
menu->installEventFilter(this);
QApplication::instance()->installEventFilter(this);
menu->popup(m_menuPosition);
connect(menu, &QMenu::aboutToHide, [menu]() {
menu->deleteLater();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment