Bug 476600 - Selecting files in klipper does not make them available to xdg-desktop-portal
Summary: Selecting files in klipper does not make them available to xdg-desktop-portal
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard (show other bugs)
Version: 5.27.8
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-05 18:14 UTC by Alessandro Astone
Modified: 2024-02-19 02:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Astone 2023-11-05 18:14:09 UTC
When I copy a file in Dolphin it gets "application/vnd.portal.filetransfer" as a possible mime type, and the file is indeed available to be pasted in Flatpaks. When selecting the same file, or an older file, in the klipper history it does not get the same mime type and cannot be pasted in Flatpaks.


STEPS TO REPRODUCE
1. Copy an image file
2. Open the clipboard applet
3. Click the top most entry, that should be the image you just copied
4. CTRL+V in Telegram Desktop

OBSERVED RESULT
Telegram shows the "Send an image" dialog

EXPECTED RESULT
Telegram shows a Toast saying "File /home/foo/bar.jpg is empty and can't be sent"

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 39 KDE
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
When taking a screenshot with the Spectacle keyboard shortcuts the file path is copied to the clipboard, but the mime type "application/vnd.portal.filetransfer" is also missing and the screenshot cannot be pasted in Flatpaks. This may or may not be the same issue. If not, i will open the same bug report against spectacle.
Comment 1 Nate Graham 2024-02-13 16:59:31 UTC
Git commit fbbcc6a4f8e1f91eddba969d66030c41449b86ca by Nate Graham, on behalf of Karol Kosek.
Committed on 13/02/2024 at 16:59.
Pushed by ngraham into branch 'master'.

klipper: Expose selected files through desktop portal

Allow sandboxed applications to get file access through portal after
switching the clipboard buffer.

M  +1    -0    klipper/historyurlitem.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/fbbcc6a4f8e1f91eddba969d66030c41449b86ca
Comment 2 Nate Graham 2024-02-13 17:22:24 UTC
Git commit c0c629228b3e33aa826aa91e954184fe20677a82 by Nate Graham, on behalf of Karol Kosek.
Committed on 13/02/2024 at 16:59.
Pushed by ngraham into branch 'Plasma/6.0'.

klipper: Expose selected files through desktop portal

Allow sandboxed applications to get file access through portal after
switching the clipboard buffer.


(cherry picked from commit fbbcc6a4f8e1f91eddba969d66030c41449b86ca)

M  +1    -0    klipper/historyurlitem.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/c0c629228b3e33aa826aa91e954184fe20677a82
Comment 3 Nate Graham 2024-02-13 17:39:12 UTC
Git commit c7c8dc6f7a2d7d8afe9a44c9fd2444b12f2514e8 by Nate Graham, on behalf of Karol Kosek.
Committed on 13/02/2024 at 17:00.
Pushed by ngraham into branch 'Plasma/5.27'.

klipper: Expose selected files through desktop portal

Allow sandboxed applications to get file access through portal after
switching the clipboard buffer.


(cherry picked from commit fbbcc6a4f8e1f91eddba969d66030c41449b86ca)

M  +1    -0    klipper/historyurlitem.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/c7c8dc6f7a2d7d8afe9a44c9fd2444b12f2514e8