https://bugs.kde.org/show_bug.cgi?id=504469

            Bug ID: 504469
           Summary: Klipper copies many unnecessary mime types
    Classification: Plasma
           Product: plasmashell
      Version First 6.3.4
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Clipboard widget & pop-up
          Assignee: plasma-b...@kde.org
          Reporter: pbs3...@googlemail.com
                CC: qydwhotm...@gmail.com
  Target Milestone: 1.0

SUMMARY

When copying an object in Inkscape, Klipper requests the clipboard content in a
large number of unnecessary mime types. Generating the extra formats makes
copying noticeably slow and bloats clipboard history size.

This is a follow-up to

https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5315
https://gitlab.com/inkscape/inkscape/-/issues/5528

STEPS TO REPRODUCE

1. Open Inkscape and observe calls to ClipboardManagerImpl::_onGet().
2. Draw a Rectangle.
3. Copy.

OBSERVED RESULT

The following mime types are requested:

text/plain
text/plain
image/png
text/plain
text/plain
image/png
text/xml+fxg
text/html
text/x-tex
text/xml+xaml
text/x-povray-script

EXPECTED RESULT

Only image/svg+xml should be requested.

SOFTWARE/OS VERSIONS

KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Graphics Platform: X11

ADDITIONAL INFORMATION

The assessment at

https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5315#note_1164002:
> Some MIME types like image/svg from Inkscape could cause it to hang because
> accessing data of the type means Inkscape will have to export the copied 
> elements,
> and if there are many elements, it will explode.

is wrong; Inkscape does not explode because it is exporting too many elements
(otherwise how would copy/paste have ever worked?), it is because Klipper is
requesting export in every single advertised format - essentially a
denial-of-service.

Inkscape advertises a large list of mime types to provide interoperability with
programs that only understand those formats. The intent is definitely not that
they should all be copied.

Only image/svg+xml needs to be copied in order to preserve the clipboard
content losslessly, as all other formats are derived from that by exporting.

The latest fix (!5315) only reduced the list of requested formats; it is is
still sufficiently long to make copying take a second. It also appears to
contain duplicates, for some reason.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to