Bug 142889 - Unable to copy/paste images from native QT applications on Wayland
Summary: Unable to copy/paste images from native QT applications on Wayland
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Wayland KDE, KF5
  Show dependency treegraph
 
Reported: 2021-06-16 08:15 UTC by daanturo
Modified: 2021-08-27 02:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description daanturo 2021-06-16 08:15:58 UTC
Description:
On KDE Plasma 5.22.1 (Wayland) and Wayland GNOME (when QT applications are run with QT_QPA_PLATFORM=wayland), cannot copy & paste images from Spectacle, Kolour Paint, Gwenview to Libre Writer.

Steps to Reproduce:
- From Spectacle:
1. Take a screenshot with Spectacle
2. Press "Copy to clipboard"

- From Kolour Paint:
1. Select All
2. Edit -> Copy

3. In Libre Writer, paste


Actual Results:
Nothing happens

Expected Results:
The image is pasted on the document


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.1.4.2 / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 8; OS: Linux 5.12; UI render: default; VCL: kf5
Locale: en-GB (en_GB.UTF-8); UI: en-US
7.1.4-1
Calc: threaded

Pasting images among Spectacle, Kolour Paint, GIMP, Google Docs on Firefox (MOZ_ENABLE_WAYLAND=1) is fine.
Comment 1 Michael Weghorn 2021-06-23 10:11:31 UTC
Reproduced in a Plasma Wayland session on Debian testing (libqt5core5a:amd64 5.15.2+dfsg-7, plasma-desktop 4:5.20.5-4) with

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 949658028e722e5d2657b503eb20e16e41dbd8cf
CPU threads: 12; OS: Linux 5.10; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 2 Jan-Marek Glogowski 2021-08-27 02:08:51 UTC
So Debian Bullseye is out, I just updated my Buster and now tried to repo some Wayland LO bugs. I used Spectacle and simply copied the screenshot into clipboard.

$ wl-paste -l
application/x-qt-image
x-kde-force-image-copy
image/png
image/avif
image/bmp
...
[many more]

On paste LO requests "image/png" (I didn't look into the code why; probably because it's the first image).

$ wl-paste -t image/png >/tmp/unknown.data

$ hexdump -C /tmp/unknown.data | head -n 1
00000000  42 4d 36 ec 5e 00 00 00  00 00 36 00 00 00 28 00  |BM6.^.....6...(.|

The clipboard delivers "image/bmp" instead :-(

While it's a KDE desktop, also the gtk3 VCL can't paste that image, because LO tries to decode the clipboard data with the PNG reader and fails.

KDE bug tracker already has: https://bugs.kde.org/show_bug.cgi?id=436956, so I'll report there first.
Comment 3 Jan-Marek Glogowski 2021-08-27 02:50:58 UTC
Already got a reply. It's very likely a Qt bug fixed by https://codereview.qt-project.org/c/qt/qtwayland/+/366769

Workarounds for LO would still leave all other non-qt apps buggy with Plasma, so I think this needs to wait for fixed Qt5 :-(