<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>512067</bug_id>
          
          <creation_ts>2025-11-14 08:49:54 +0000</creation_ts>
          <short_desc>Clipboard portal can&apos;t copy from primary selection</short_desc>
          <delta_ts>2025-11-14 19:53:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>xdg-desktop-portal-kde</product>
          <component>general</component>
          <version>6.5.1</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=511989</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>HI</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam">adaha</reporter>
          <assigned_to name="Plasma Bugs List">plasma-bugs-null</assigned_to>
          <cc>aleixpol</cc>
    
    <cc>kde</cc>
    
    <cc>nate</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/6cd84564b19dfa28b32d9d2848f91e913c668cca</cf_commitlink>
          <cf_versionfixedin>6.5.3</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2470208</commentid>
    <comment_count>0</comment_count>
    <who name="Adam">adaha</who>
    <bug_when>2025-11-14 08:49:54 +0000</bug_when>
    <thetext>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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2470268</commentid>
    <comment_count>1</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2025-11-14 13:43:32 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/482</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2470350</commentid>
    <comment_count>2</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2025-11-14 18:25:31 +0000</bug_when>
    <thetext>Git commit a0c60666dccf4389576dc159d70298d48707fafb by Nate Graham, on behalf of David Redondo.
Committed on 14/11/2025 at 18:25.
Pushed by ngraham into branch &apos;master&apos;.

clipboard: Don&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2470359</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2025-11-14 19:53:49 +0000</bug_when>
    <thetext>Git commit 6cd84564b19dfa28b32d9d2848f91e913c668cca by Nate Graham.
Committed on 14/11/2025 at 18:27.
Pushed by ngraham into branch &apos;Plasma/6.5&apos;.

clipboard: Don&apos;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 &lt;kde@david-redondo.de&gt;

M  +4    -1    src/clipboard.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/6cd84564b19dfa28b32d9d2848f91e913c668cca</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>