Bug 425997 - Pressing 'Shift' to change 'Move to trash' to 'delete' does not work when a sub-context-menu is open
Summary: Pressing 'Shift' to change 'Move to trash' to 'delete' does not work when a s...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: 5.19.4
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-30 17:04 UTC by Derek Christ
Modified: 2021-07-18 20:25 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22.4


Attachments
Expected result (31.58 KB, image/png)
2020-08-30 17:04 UTC, Derek Christ
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Christ 2020-08-30 17:04:49 UTC
Created attachment 131296 [details]
Expected result

SUMMARY
Pressing 'Shift' to change 'Move to trash' to 'delete' does not work when the mouse is hovering over an element which opens a sub-menu in the context menu.

This is slowing down workflow because this happens often accidentally.

STEPS TO REPRODUCE
1. Right click on a file
2. Press shift to observe that 'Move to trash' changes to 'Delete'
3. Hover an element in the context menu that opens a sub-menu
4. Press shift again and observe that it will not change any more

OBSERVED RESULT
'Move to trash' stays

EXPECTED RESULT
'Move to trash' changes to 'Delete'

Operating System: Arch Linux
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.8.5-arch1-1
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 15.6 GiB of RAM
Graphics Processor: Radeon RX Vega
Comment 1 Nate Graham 2020-09-08 14:35:41 UTC
Can reproduce. Thanks for the nice clear bug report.
Comment 2 Bug Janitor Service 2020-10-15 21:34:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/79
Comment 3 Elvis Angelaccio 2020-11-23 22:09:05 UTC
Git commit 9e4642d435085f27134ed6c8431734dcacf65834 by Elvis Angelaccio, on behalf of Derek Christ.
Committed on 23/11/2020 at 22:07.
Pushed by elvisangelaccio into branch 'master'.

Fix delete action switching via 'Shift' when sub-context-menu is open

Switching the 'Move to Trash' action to 'Delete' using the shift key
does not work when the mouse hovers a submenu. This fix resolves the
issue by using an event filter instead of the key event functions.

M  +19   -8    src/dolphincontextmenu.cpp
M  +2    -2    src/dolphincontextmenu.h

https://invent.kde.org/system/dolphin/commit/9e4642d435085f27134ed6c8431734dcacf65834
Comment 4 Méven Car 2020-12-05 17:10:33 UTC
Git commit 13a508bcabb1185adb05e30c70a00bacfa74f10a by Méven Car.
Committed on 04/12/2020 at 16:19.
Pushed by meven into branch 'master'.

Linking fileitemplugin: use parent Widget as menu parent

It is to allow the parent to add EventFilter to its children.

M  +1    -1    activities/fileitemplugin/FileItemLinkingPlugin.cpp

https://invent.kde.org/network/kio-extras/commit/13a508bcabb1185adb05e30c70a00bacfa74f10a
Comment 5 Méven Car 2020-12-05 17:11:12 UTC
Git commit 26c790b360a41695de210cbf12117b2402ca7326 by Méven Car.
Committed on 05/12/2020 at 06:48.
Pushed by meven into branch 'master'.

Tagging fileitemplugin: use parent Widget as menu parent

It is to allow the parent to add EventFilter to its children.

M  +2    -1    src/tagsfileitemactionplugin/tagsfileitemaction.cpp

https://invent.kde.org/libraries/baloo-widgets/commit/26c790b360a41695de210cbf12117b2402ca7326
Comment 6 Méven Car 2020-12-05 17:12:01 UTC
Git commit b0fb8fd1ab9f39a7dfc9f10cbb7f945e60022bd3 by Méven Car.
Committed on 05/12/2020 at 17:11.
Pushed by meven into branch 'master'.

Share fileitemplugin: use parent Widget as menu parent

It is to allow the parent to add EventFilter to its children.

M  +1    -2    src/fileitemactionplugin/sharefileitemaction.cpp

https://invent.kde.org/frameworks/purpose/commit/b0fb8fd1ab9f39a7dfc9f10cbb7f945e60022bd3
Comment 7 Elvis Angelaccio 2020-12-07 22:47:02 UTC
Git commit ce3c2435250f5eb8a3c9322359b25c46d2b6fb96 by Elvis Angelaccio, on behalf of Méven Car.
Committed on 07/12/2020 at 22:13.
Pushed by elvisangelaccio into branch 'master'.

ContextMenu: Allow plugins submenus to react to Shift modifiers

In 9e4642d435085f27134ed6c8431734dcacf65834 support was added for the
NewFileMenu.
This adds support for the Plugins submenu provided they relay their
parentWidget to their own menus.

M  +1    -1    src/dolphincontextmenu.cpp

https://invent.kde.org/system/dolphin/commit/ce3c2435250f5eb8a3c9322359b25c46d2b6fb96
Comment 8 Elvis Angelaccio 2021-01-02 18:35:28 UTC
Git commit f8d1b494db19904679101139eb81a5715061aa11 by Elvis Angelaccio.
Committed on 02/01/2021 at 18:22.
Pushed by elvisangelaccio into branch 'master'.

Revert "ContextMenu: Allow plugins submenus to react to Shift modifiers"

This reverts commit ce3c2435250f5eb8a3c9322359b25c46d2b6fb96.

The apidox of setParentWidget says:

    Set the parent widget for any dialogs being shown.
    This should normally be your mainwindow, not a popup menu, so that it still exists even after the popup is closed
    (e.g. error message from KRun) and so that QAction::setStatusTip can find a statusbar, too.

M  +1    -1    src/dolphincontextmenu.cpp

https://invent.kde.org/system/dolphin/commit/f8d1b494db19904679101139eb81a5715061aa11
Comment 9 Elvis Angelaccio 2021-01-02 18:36:17 UTC
Re-opening after revering the latest commit. We need to find another solution.
Comment 10 Bug Janitor Service 2021-06-18 13:35:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/225
Comment 11 Bug Janitor Service 2021-06-19 22:08:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/510
Comment 12 Méven Car 2021-06-22 09:49:47 UTC
Git commit dc3beae3ab2c55cd3501e17f93b51e93e876a177 by Méven Car, on behalf of Derek Christ.
Committed on 22/06/2021 at 08:53.
Pushed by felixernst into branch 'release/21.04'.

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.
FIXED-IN: 21.04

M  +8    -13   src/dolphincontextmenu.cpp
M  +1    -2    src/dolphincontextmenu.h

https://invent.kde.org/system/dolphin/commit/dc3beae3ab2c55cd3501e17f93b51e93e876a177
Comment 13 Nate Graham 2021-07-18 20:24:57 UTC
Git commit 48ecda47defb671b654ee9633b2a8e623699e7d5 by Nate Graham, on behalf of Derek Christ.
Committed on 18/07/2021 at 20:17.
Pushed by ngraham into branch 'Plasma/5.22'.

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.
FIXED-IN: 5.22

M  +1    -0    containments/desktop/plugins/folder/foldermodel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/48ecda47defb671b654ee9633b2a8e623699e7d5
Comment 14 Nate Graham 2021-07-18 20:25:30 UTC
Git commit 1b9b49b9fa823246c1880232e063c97fd7a916eb by Nate Graham, on behalf of Derek Christ.
Committed on 18/07/2021 at 20:25.
Pushed by ngraham into branch 'master'.

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.
FIXED-IN: 5.22


(cherry picked from commit 48ecda47defb671b654ee9633b2a8e623699e7d5)

M  +1    -0    containments/desktop/plugins/folder/foldermodel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/1b9b49b9fa823246c1880232e063c97fd7a916eb