Bug 512067 - Clipboard portal can't copy from primary selection
Summary: Clipboard portal can't copy from primary selection
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.5.1
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-14 08:49 UTC by adaha
Modified: 2025-11-14 19:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.5.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adaha 2025-11-14 08:49:54 UTC
SUMMARY
When selecting text in KDE in a RemoteDesktop session with the Clipboard portal enabled, the SelectionOwnerChanged signal is emitted. When requesting data from one of the available mimetypes, instead of reading from the primary, it will read from selection.

STEPS TO REPRODUCE
1. Copy text into selection (CTRL+C)
2. Copy text into primary (select text)
3. Read selection data (CTRL+V on client)

OBSERVED RESULT
The clipboard will read from selection, even when it seems like the primary selection was the one that triggered the signal.

EXPECTED RESULT
Unfortunately, the protocol does not mention the primary selection. I would expect primary to either not work (no signal emitted for primary), or for both primary and selection to be affected when reading from / writing to the clipboard.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 43
KDE Plasma Version:  6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
xdg-desktop-portal-kde-6.5.2-1 (+ patch https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/b7f2107d0eb35d2b4cfccf9ffaa91437b88eff0a)
Comment 1 Bug Janitor Service 2025-11-14 13:43:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/482
Comment 2 Nate Graham 2025-11-14 18:25:31 UTC
Git commit a0c60666dccf4389576dc159d70298d48707fafb by Nate Graham, on behalf of David Redondo.
Committed on 14/11/2025 at 18:25.
Pushed by ngraham into branch 'master'.

clipboard: Don't emit changes for primary selection

The portal handles only selection
FIXED-IN: 6.5.3

M  +4    -1    src/clipboard.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/a0c60666dccf4389576dc159d70298d48707fafb
Comment 3 Nate Graham 2025-11-14 19:53:49 UTC
Git commit 6cd84564b19dfa28b32d9d2848f91e913c668cca by Nate Graham.
Committed on 14/11/2025 at 18:27.
Pushed by ngraham into branch 'Plasma/6.5'.

clipboard: Don't emit changes for primary selection

The portal handles only selection
FIXED-IN: 6.5.3


(cherry picked from commit a0c60666dccf4389576dc159d70298d48707fafb)

2c69b04e clipboard: Dont emit changes for primary selection
0234cd27 Edit clipboard.cpp

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +4    -1    src/clipboard.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/6cd84564b19dfa28b32d9d2848f91e913c668cca