https://bugs.kde.org/show_bug.cgi?id=429403

            Bug ID: 429403
           Summary: Changing shortcut for "Move to Trash" breaks Delete
                    key in text fields/editors
           Product: plasma-integration
           Version: 5.20.3
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: plasma-b...@kde.org
          Reporter: vovams...@gmail.com
  Target Milestone: ---

SUMMARY

Changing key combination for action "Move to Trash" in System Settings app
causes Delete key to not work in text fields and text editors in many Qt apps.
After changing the key combination Delete key does nothing, but the
newly-assigned key works as Delete (i.e. deletes character in front of cursor).

STEPS TO REPRODUCE

1. Open System Settings application and go to Workspace > Shortcuts > Shortcuts
> Common actions > File
2. Find and expand "Move to Trash" action
3. Uncheck "Del" under "Default shortcut"
4. Click "Add custom shortcut" and press F12 key
5. Click "Apply"

OBSERVED RESULT

Immediately after clicking "Apply" Delete key stops working in the "Search..."
text field at the top of the System Settings window and F12 works instead of
it. After logging out and logging in the issue appears in other applications as
well (tested in Kickoff, KRunner, Dolphin).

EXPECTED RESULT

Changing key combination for "Move to Trash" should not affect which key is
used to delete a character in front of cursor in text fields.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: KDE neon 5.20 User Edition (neon-user-20201119-0945.iso)
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

I initially found this issue in my openSUSE Tumbleweed system and later
reproduced it in a VM running KDE neon.

ADDITIONAL INFORMATION

I think that the problem is in KdePlatformTheme::keyBindings() . In the
following line it returns KStandardShortcut::MoveToTrash shortcut for
QKeySequence::Delete:

https://github.com/KDE/plasma-integration/blob/00fc43a2b71a421395e10b0cee8e67a09e398fe9/src/platformtheme/kdeplatformtheme.cpp#L262

The description of QKeySequence::Delete in Qt documentation is not very
specific, but Qt itself uses it in implementation of text fields to determine
which key should delete character in front of cursor. For example, here:

https://github.com/qt/qtbase/blob/e4961b35deb202525d4711dbb14f8c2bb0bf5c26/src/widgets/widgets/qwidgettextcontrol.cpp#L1325

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to