SUMMARY wl-clipboard can be used on Plasma Wayland and Klipper, and is a replacement for xclip. wl-clipboard includes two subcommands, wl-copy and wl-paste. Text passed to the clipboard via wl-copy works fine. However, if you copy an image to wl-copy, while it does get sent to the clipboard (as can be seen by running wl-paste --list-types) and the content can be pasted (both Dolphin and Nautilus acknowledge the image in the clipboard when you press Ctrl+V), Klipper itself does not show that the image is in the clipboard. STEPS TO REPRODUCE 1. Create an image with spectacle --background --nonotify -o image.png 2. Put the image in the clipboard with wl-copy < image.png 3. Verify that it is in the clipboard with wl-paste --list-types (the output should be image/png) 4. Open Klipper and notice no indication that there is an image in the clipboard 5. Open Dolphin and press Ctrl+V, you should see a field for creating a name for the clipboard content, put any different name 6. Notice how the correct image is pasted 7. Open Klipper and notice no indication that there is an image in the clipboard SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20210916 KDE Plasma Version: 5.23.80 KDE Frameworks Version: 5.87.0 Qt Version: 5.15.2 Kernel Version: 5.14.2-1-default (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Core™ i7-5500U CPU @ 2.40GHz Memory: 7.7 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 5500
>Klipper itself does not show that the image is in the clipboard. Please confirm your klipper settings do not have "ignore images" set.
Actually "Ignore images" was set, but disabling it didn't make a difference. I also did a full relogin and reboot to confirm, just in case.
Indeed. It's failing here: else if (data->hasImage()) { despite having the format image/png
Urgh, because some magic happens in QInternalMimeData which we don't inherit from. We'll need to either use QPlatformHeaders (which is naughty but easy) or copy and paste the relevant image code for: has_format/formats/retrieveData (~100 lines)
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1208
Git commit 756d5c51c999df6ec324b794a4eefc9d42e33032 by Méven Car, on behalf of Méven Car. Committed on 24/11/2021 at 13:46. Pushed by meven into branch 'master'. Use KGuiAddons::KSystemClipboard to better handle wayland Allow klipper to read image data from clipboard M +3 -5 klipper/CMakeLists.txt M +3 -4 klipper/klipper.cpp M +2 -2 klipper/klipper.h D +0 -27 klipper/systemclipboard/CMakeLists.txt D +0 -31 klipper/systemclipboard/qtclipboard.cpp D +0 -17 klipper/systemclipboard/qtclipboard.h D +0 -34 klipper/systemclipboard/systemclipboard.cpp D +0 -47 klipper/systemclipboard/systemclipboard.h D +0 -5 klipper/systemclipboard/tests/CMakeLists.txt D +0 -33 klipper/systemclipboard/tests/paste.cpp D +0 -424 klipper/systemclipboard/waylandclipboard.cpp D +0 -25 klipper/systemclipboard/waylandclipboard.h D +0 -278 klipper/systemclipboard/wlr-data-control-unstable-v1.xml https://invent.kde.org/plasma/plasma-workspace/commit/756d5c51c999df6ec324b794a4eefc9d42e33032