<?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>520175</bug_id>
          
          <creation_ts>2026-05-15 01:37:49 +0000</creation_ts>
          <short_desc>KRdp session freezes for several minutes on certain clipboard copies</short_desc>
          <delta_ts>2026-06-25 21:17:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>KRdp</product>
          <component>general</component>
          <version>6.6.4</version>
          <rep_platform>Kubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>efficiency-and-performance</keywords>
          <priority>VHI</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Hoskinson">paul_kde</reporter>
          <assigned_to name="Unassigned bugs">unassigned-bugs-null</assigned_to>
          <cc>ahiemstra</cc>
    
    <cc>kde</cc>
    
    <cc>nate</cc>
    
    <cc>paul_kde</cc>
    
    <cc>putr4.s</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/krdp/-/commit/f777389591627dd8bfa10fd487a755aadcd74811</cf_commitlink>
          <cf_versionfixedin>6.7.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2515834</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Hoskinson">paul_kde</who>
    <bug_when>2026-05-15 01:37:49 +0000</bug_when>
    <thetext>DESCRIPTION
When connected to a Kubuntu 26.04 wayland KRDP server using Remmina client, when I copy text or images to the clipboard from certain Wayland applications (Firefox, Remmina) the whole RDP session freezes for several minutes.

STEPS TO REPRODUCE
1. Start an RDP session to KRDP server 
2. Select text in Firefox and copy to clipboard

OBSERVED RESULT
Session instantly freezes for several minutes. Krdpserver process is unresponsive
Log contains the message: org.kde.krdp: PipeWire frame did not contain usable image data

EXPECTED RESULT
No freeze

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 26.04
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2

ADDITIONAL INFORMATION

The following patch eliminates the issue for me locally:

$ git diff -- src/PortalSession.cpp
diff --git a/src/PortalSession.cpp b/src/PortalSession.cpp
index 94d472a..54f3f87 100644
--- a/src/PortalSession.cpp
+++ b/src/PortalSession.cpp
@@ -105,14 +105,22 @@ PortalSession::PortalSession()
             return;
         }
 
+        qCDebug(KRDP) &lt;&lt; &quot;Clipboard formats:&quot; &lt;&lt; data-&gt;formats() &lt;&lt; &quot;hasText:&quot; &lt;&lt; data-&gt;hasText();
+
         // KSystemClipboard takes ownership of any QMimeData passed to it but
         // does not relinquish ownership over anything it returns. So manually
         // copy over the contents to a new instance of QMimeData so we can keep
         // the semantics the same.
+        //
+        // Only copy text data here. Fetching arbitrary clipboard MIME payloads
+        // can block for a long time on Wayland/XWayland targets such as
+        // SAVE_TARGETS, which freezes the server&apos;s main thread. The RDP
+        // clipboard implementation currently only exposes text anyway.
         auto newData = new QMimeData();
-        const auto formats = data-&gt;formats();
-        for (auto format : formats) {
-            newData-&gt;setData(format, data-&gt;data(format));
+        if (data-&gt;hasText()) {
+            newData-&gt;setText(data-&gt;text());
+        } else {
+            qCDebug(KRDP) &lt;&lt; &quot;Ignoring non-text clipboard update with formats&quot; &lt;&lt; data-&gt;formats();
         }
 
         Q_EMIT clipboardDataChanged(newData);

Summary of changes:
- clipboard owners may advertise safe text formats plus problematic side formats
- KRDP eagerly fetches everything
- after the changes, KRDP only fetches plain text when available
- that avoids the blocking format fetches and fixes the freeze
- KRDP’s current RDP clipboard implementation only advertises and transfers plain text (CF_UNICODETEXT), so fetching non-text MIME payloads provides no benefit to clients and only adds risk of blocking on expensive or problematic clipboard targets like SAVE_TARGETS.

This patch produces the following debug output when copying from applications that previously caused the freeze:

org.kde.krdp: Clipboard formats: QList(&quot;text/plain;charset=utf-8&quot;, &quot;UTF8_STRING&quot;, &quot;COMPOUND_TEXT&quot;, &quot;TEXT&quot;, &quot;text/plain&quot;, &quot;STRING&quot;, &quot;SAVE_TARGETS&quot;) hasText: true

org.kde.krdp: Clipboard formats: QList(&quot;text/html&quot;, &quot;text/_moz_htmlinfo&quot;, &quot;text/_moz_htmlcontext&quot;, &quot;image/png&quot;, &quot;image/avif&quot;, &quot;image/bmp&quot;, &quot;image/x-bmp&quot;, &quot;image/x-MS-bmp&quot;, &quot;image/x-icon&quot;, &quot;image/x-ico&quot;, &quot;image/x-win-bitmap&quot;, &quot;image/vnd.microsoft.icon&quot;, &quot;application/ico&quot;, &quot;image/ico&quot;, &quot;image/icon&quot;, &quot;text/ico&quot;, &quot;image/jpeg&quot;, &quot;image/tiff&quot;, &quot;image/webp&quot;) hasText: false

May 14 18:20:36 paul-adion krdpserver[11199]: org.kde.krdp: Ignoring non-text clipboard update with formats QList(&quot;text/html&quot;, &quot;text/_moz_htmlinfo&quot;, &quot;text/_moz_htmlcontext&quot;, &quot;image/png&quot;, &quot;image/avif&quot;, &quot;image/bmp&quot;, &quot;image/x-bmp&quot;, &quot;image/x-MS-bmp&quot;, &quot;image/x-icon&quot;, &quot;image/x-ico&quot;, &quot;image/x-win-bitmap&quot;, &quot;image/vnd.microsoft.icon&quot;, &quot;application/ico&quot;, &quot;image/ico&quot;, &quot;image/icon&quot;, &quot;text/ico&quot;, &quot;image/jpeg&quot;, &quot;image/tiff&quot;, &quot;image/webp&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2515875</commentid>
    <comment_count>1</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2026-05-15 07:51:53 +0000</bug_when>
    <thetext>&gt;- KRDP’s current RDP clipboard implementation only advertises and transfers plain text (CF_UNICODETEXT)

Makes sense as a short term solution at least.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2516803</commentid>
    <comment_count>2</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2026-05-19 10:37:18 +0000</bug_when>
    <thetext>What&apos;s your full name? I should put you as the commit author.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2516804</commentid>
    <comment_count>3</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2026-05-19 10:37:59 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/krdp/-/merge_requests/179</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2516920</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Hoskinson">paul_kde</who>
    <bug_when>2026-05-19 17:31:20 +0000</bug_when>
    <thetext>(In reply to David Edmundson from comment #2)
&gt; What&apos;s your full name? I should put you as the commit author.

Paul Hoskinson</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2518688</commentid>
    <comment_count>5</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2026-05-27 12:19:08 +0000</bug_when>
    <thetext>Git commit ea02751b9aa11a4a201e2f9aa68a040c3375a941 by David Edmundson, on behalf of Paul Hoskinson.
Committed on 27/05/2026 at 12:14.
Pushed by davidedmundson into branch &apos;master&apos;.

Ignore non-text mimetypes

Krdp has to copy the mimetype data before announcing it has a clipboard
to avoid some issues. This is potentially expensive.

We only send text at an RDP level currently, so instead only handle text
mimetypes.

M  +11   -3    src/PortalSession.cpp

https://invent.kde.org/plasma/krdp/-/commit/ea02751b9aa11a4a201e2f9aa68a040c3375a941</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2519247</commentid>
    <comment_count>6</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2026-05-29 17:45:20 +0000</bug_when>
    <thetext>Git commit f777389591627dd8bfa10fd487a755aadcd74811 by Nate Graham.
Committed on 29/05/2026 at 17:19.
Pushed by ngraham into branch &apos;Plasma/6.7&apos;.

Ignore non-text mimetypes

Krdp has to copy the mimetype data before announcing it has a clipboard
to avoid some issues. This is potentially expensive.

We only send text at an RDP level currently, so instead only handle text
mimetypes.


(cherry picked from commit ea02751b9aa11a4a201e2f9aa68a040c3375a941)

Co-authored-by: Paul Hoskinson &lt;paul_kde@inbox.hosk.ca&gt;

M  +11   -3    src/PortalSession.cpp

https://invent.kde.org/plasma/krdp/-/commit/f777389591627dd8bfa10fd487a755aadcd74811</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2526768</commentid>
    <comment_count>7</comment_count>
    <who name="TraceyC">kdedev</who>
    <bug_when>2026-06-25 21:17:24 +0000</bug_when>
    <thetext>*** Bug 520260 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>