Bug 514073

Summary: XDG FileChooser Portal - Backspace goes back to previous directory instead of removing a symbol
Product: [Plasma] xdg-desktop-portal-kde Reporter: kvl_demon
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: NEEDSINFO WAITINGFORINFO    
Severity: normal CC: aleixpol, kde
Priority: NOR    
Version First Reported In: 6.5.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: XDG Portal screencast with Telegram

Description kvl_demon 2026-01-02 12:10:12 UTC
SUMMARY
When KDE XDG Portal is used to save a file, pressing "Backspace" goes to previous directory instead of removing a symbol even if file name input is focused.

STEPS TO REPRODUCE
1. Launch KDE XDG FileChooser Portal (eg, by saving a file from Firefox)
2. Jump between several directories (so "Go back" button becomes active)
3. Focus "Name" input (by clicking on it or even selecting the whole name)
4. Press "Backspace"

OBSERVED RESULT
FileChooser Portal switches to previous directory (i.e., "Go back" action is triggered) until there are entries in "history" ("Go back" button is active) when "Backspace" is pressed. All subsequent "Backspace" presses actually remove a symbol before the cursor.
Pressing other keys (e.g., letters) successfully recorded by "Name" input field.

EXPECTED RESULT
"Backspace" should remove a symbol on press when any input field is focused.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 6.18.2
KDE Plasma Version: 6.5.4-1
KDE Frameworks Version: 6.21.0-1
Qt Version: 6.10.1-1

ADDITIONAL INFORMATION
1. "Native" Save File dialogs handle "Backspace" correctly (i.e, matches EXPECTED RESULT above)
2. Removing "Backspace" from Dolphin Keyboard Shortcuts does not change the OBSERVED RESULT
3. Similar (duplicate?) of https://bugs.kde.org/show_bug.cgi?id=512836
Comment 1 David Edmundson 2026-01-02 12:39:58 UTC
I cannot reproduce.  

Can you make a screencast?
Comment 2 kvl_demon 2026-01-02 14:49:25 UTC
I have originally faced this issue with Telegram Desktop. Based on my basic (and probably incorrect) understanding of XDG Portal mechanism, I've incorrectly assumed that this issue should be present for all uses of KDE XDG Portal, but that seems to be NOT the case on practice.

I have done a bit more testing and do NOT see this issue for most of my apps (including Firefox and Chrome browsers), but still see it for Telegram (screencast attached). The only relevant entries I see in Telegram debug logs are stuff like:
```
qt.qpa.wayland.textinput: virtual void QtWaylandClient::QWaylandTextInputv3::enableSurface(wl_surface*) Try to enable surface 0x560cd98bb5d0 with focusing surface 0x560ccfead8f0
qt.qpa.wayland.textinput: virtual void QtWaylandClient::QWaylandTextInputv3::enableSurface(wl_surface*) Try to enable surface 0x560ccfead8f0 with focusing surface 0x560cd98bb5d0
qt.qpa.wayland.textinput: virtual void QtWaylandClient::QWaylandTextInputv3::enableSurface(wl_surface*) Try to enable surface 0x560cd9c02e30 with focusing surface 0x560ccfead8f0
qt.qpa.wayland.textinput: virtual void QtWaylandClient::QWaylandTextInputv3::enableSurface(wl_surface*) Try to enable surface 0x560cd662c0a0 with focusing surface 0x560ccfead8f0
```
If it matters, I am using official Telegram Desktop client from Arch repo (version 6.3.10-1).
Comment 3 kvl_demon 2026-01-02 14:50:05 UTC
Created attachment 188156 [details]
XDG Portal screencast with Telegram
Comment 4 kvl_demon 2026-01-02 15:25:46 UTC
I have also tested the identical scenario with Telegram and xdg-desktop-portal-lxqt (also Qt based) and do not see this issue with such combination - "Backspace" correctly removes a symbol before cursor if input is in focus and goes to the parent directory otherwise.