The toggle between the "move to trash" and "delete" entry in the right mouse context menu works in a wrong way. Per default the entry is "move to trash" => this is ok. When pressing shift nothing happens with the entry. It should change to "delete". When releasing the shift key, the entry is toggled to "delete" and stays this way. Holding shift again toggles back to "move to trash", but it should be "delete". Releasing shift again toggles back to "delete", but it should be "move to trash". => So the shift key exactly behaves negated. Reproducible: Always Steps to Reproduce: Open the context menu on a file by clicking the right mouse button. Press shift to toggle between the "move to trash" and "delete" entry. Actual Results: 1. open the context menu on a file by clicking the right mouse button. 2. Check that the menu entry reads "move to trash". 3. Hold down the shift key => The entry still is "move to trash". 4. Release the shift key => The entry changes to "delete". 5 Hold down the shift key again => The entry changes to "move to trash" 6. Release the shift key => The entry changes to "delete". 7. goto 5 Expected Results: 1. open the context menu on a file by clicking the right mouse button. 2. The menu entry reads "move to trash". 3. Hold down the shift key => The entry changes to "delete". 4. Release the shift key => The entry changes to "move to trash". 5. goto 3
I can confirm this on openSUSE with the latest dolphin 15.12.2. In short: pressing Shift doesn't toggle "Move to Trash" to "Delete", only *releasing* it again does. Afterwards every press and release toggles, so the behavior is completely opposite to what it should be.
*** Bug 362235 has been marked as a duplicate of this bug. ***
I can reproduce, confirming.
Patch up for review: https://git.reviewboard.kde.org/r/128972/
Git commit 3775ef19eaca057985b92cfa3716d3c3a1d22f0f by Elvis Angelaccio. Committed on 21/09/2016 at 16:13. Pushed by elvisangelaccio into branch 'Applications/16.08'. Properly check Shift toggling in DolphinRemoveAction Documentation of QGuiApplication::keyboardModifiers() says that "It should be noted this may not reflect the actual keys held on the input device at the time of calling but rather the modifiers as last reported in one of the above events". Since this method is called in DolphinContextMenu's keyPressEvent() and keyReleaseEvent(), the first time that keyboardModifiers() is called it doesn't report that shift has been pressed. Replacing this method with queryKeyboardModifiers() does the job because the latter doesn't care about the event queue. FIXED-IN: 16.08.2 REVIEW: 128972 M +1 -1 src/dolphinremoveaction.cpp http://commits.kde.org/dolphin/3775ef19eaca057985b92cfa3716d3c3a1d22f0f
This bug reappeared for me in Wayland session. Distribution: KDE neon Developer Edition Unstable Branches KDE Plasma Version: 5.10.90 KDE Frameworks Version: 5.37.0 Qt Version: 5.9.1 Kernel Version: 4.10.0-32-generic
Yep, QGuiApplication::queryKeyboardModifiers() doesn't seem to work on Wayland.
Git commit 2fd85facf85b39f84eeada10bcf80060bb72ab51 by Elvis Angelaccio. Committed on 07/09/2017 at 19:31. Pushed by elvisangelaccio into branch 'master'. Fix DolphinRemoveAction Shift toggling on Wayland QGuiApplication::queryKeyboardModifiers() does not work on Wayland [1]. We don't need it in the first place, since we already know (thanks to the key events) whether Shift has been pressed or released. So we can just pass this information to DolphinRemoveAction::update(). [1]: https://bugreports.qt.io/browse/QTBUG-62786 Differential Revision: https://phabricator.kde.org/D7519 M +2 -2 src/dolphincontextmenu.cpp M +2 -1 src/dolphinpart.cpp M +22 -7 src/dolphinremoveaction.cpp M +13 -3 src/dolphinremoveaction.h https://commits.kde.org/dolphin/2fd85facf85b39f84eeada10bcf80060bb72ab51