Bug 436956 - Multiple images copy paste issues
Summary: Multiple images copy paste issues
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard (show other bugs)
Version: 5.21.3
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-12 06:12 UTC by Michał Zubkowicz
Modified: 2021-08-27 08:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example of notification (174.73 KB, image/png)
2021-05-14 16:39 UTC, Michał Zubkowicz
Details
example clipboard (309.46 KB, image/png)
2021-05-17 21:55 UTC, Michał Zubkowicz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Zubkowicz 2021-05-12 06:12:59 UTC
SUMMARY
Copy paste of images is working in strange way. Very often I cannot paste images between the apps, or I must do it twice (first time doesn't paste anything). I know already from another bug report that Gimp related cases are Gimp fault, but Libre Office, Firefox, Edge, Chrome are also broken? I've never seen such issues in other desktop environments. I suspect it's something related to copy paste between GTK -> QT apps. 

Could you please help me to provide enough information for You to solve it to create reproducible case? My tries are:


STEPS TO REPRODUCE 
1. Run "spectacle -rbc", try to paste in Firefox or Edge in any webapp, sometimes it's working sometimes path is pasted or nothing. 
2. Open Gimp, copy image try to paste in LibreOffice, sometimes contents of image is pasted. 
3. When copying image from Dolphin in browser only image path is pasted sometimes in browser window. On second try it's working.  

OBSERVED RESULT
Images are not copied, or only paths are pasted, or file content is pasted. Worst thing it occurs randomly and sometimes it's working.

EXPECTED RESULT
It should paste image. 

SOFTWARE/OS VERSIONS
KDE Neon: 21.04 (but problems was also in previous versions)
Comment 1 Nate Graham 2021-05-13 16:08:13 UTC
All of these use cases are working for me.

Can you do the following?

1. Open the Clipboard applet in your System Tray and click the "Pin" button in the corner.
2. Copy the image in the manner you expect

If you copy an image and an image appear in the clipboard, or if you copy a file and a path appears in the clipboard or a file entry appears in the clipboard, then our system is working properly and the bug is in how the app you're pasting it into is interpreting the paste data.
Comment 2 Michał Zubkowicz 2021-05-14 09:57:06 UTC
Thanks, I'll check that.
Comment 3 Michał Zubkowicz 2021-05-14 10:09:53 UTC
I've created screenshot with "spectacle -rbc". Image is showing under clipboard icon, but paste is no working anywhere (tried Firefox, Gimp, Edge, KolourPaint). After I clicked in clipboard element on list now I can paste. 

I've created second screenshot. Now I was able to paste, but only once. 
I think the issue is here that after some typing on keyboard clipboard content is lost.
 
Also I've I remembered in meantime about very annoying issue that after pressing ctrl+c without selecting anything clipboard content is lost. It is intentional?
Comment 4 Nate Graham 2021-05-14 15:13:06 UTC
Very interesting.

So the image data gets into the clipboard but is somehow not active until you click on it.

*Before* you click on it, it is the top item, or the second item?

Also, is this happening on X11 or Wayland?
Comment 5 Michał Zubkowicz 2021-05-14 16:39:18 UTC
Created attachment 138424 [details]
Example of notification
Comment 6 Michał Zubkowicz 2021-05-14 16:42:05 UTC
It's second item like on attachment.

I've tried to reproduce it and as I can see now that new row is showing when I type something in browser's window for example in Gmail.
Comment 7 Nate Graham 2021-05-17 20:51:53 UTC
Do see the image in the clipboard applet, though?
Comment 8 Michał Zubkowicz 2021-05-17 21:10:26 UTC
Yes, there are duplicated entries there, one with image, but other with only notification text.
Comment 9 Nate Graham 2021-05-17 21:28:11 UTC
Can you send a screenshot of what the Clipboard applet looks like?
Comment 10 Michał Zubkowicz 2021-05-17 21:55:44 UTC
Created attachment 138522 [details]
example clipboard
Comment 11 Nate Graham 2021-05-18 19:03:05 UTC
The top entry in your latest screenshot is a file, not a pixmap from an image. What did you do to get that there? When I do `spectacle -rbc` I get a pixmap entry which can be pasted into apps that accept pixmap clipboard data.
Comment 12 Michał Zubkowicz 2021-05-20 10:42:18 UTC
It was spectacle -rbc, it always show two entries as I'm checking now. In Messenger web app ctrl+v pastes two images instead of one what is really strange also. 

I've discovered that I had unchecked option "Ignore selection" which probably was fault of disappearing items from clipboard.
Comment 13 Bug Janitor Service 2021-06-04 04:33:31 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Michał Zubkowicz 2021-06-04 15:27:09 UTC
I've provided info
Comment 15 Jan-Marek Glogowski 2021-08-27 02:22:16 UTC
I might be hijacking this report and it might be a different problem, but it looks the same. I just analyzed a LibreOffice image pasting bug on Wayland in https://bugs.documentfoundation.org/show_bug.cgi?id=142889

Repo:

1. spectacle -> copy to clipboard
2. "wl-paste -l" lists "image/png"
3. "wl-paste -t image/png >/tmp/unknown.data"
4. "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...(.|

So instead of ~375k PNG, which I get from spectacle on save, I got a 6.2m BMP from the clipboard, which LO's PNG reader doesn't like :-(

That's for my freshly updated Debian Bullseye, which has some KDE 5.20.5 variant.
Comment 16 Nate Graham 2021-08-27 02:27:59 UTC
Jan-Marek, that specific issue appears to be caused by a Qt bug, which KDE developer Jan Pontaoski has helpfully fixed already in https://codereview.qt-project.org/c/qt/qtwayland/+/366769. The fix will be backported into the KDE patch collection for Qt 5.15.
Comment 17 Jan-Marek Glogowski 2021-08-27 02:46:11 UTC
(In reply to Nate Graham from comment #16)
> Jan-Marek, that specific issue appears to be caused by a Qt bug, which KDE
> developer Jan Pontaoski has helpfully fixed already in
> https://codereview.qt-project.org/c/qt/qtwayland/+/366769. The fix will be
> backported into the KDE patch collection for Qt 5.15.

Thanks for the quick reply. Very much looks like my LO bug. Now I just need to tell Debian to fix a non-security bug in QtWayland; it is really nasty...

(I could use a QImage to catch the "application/x-qt-image" type and use convertToFormat to get the right stuff, but this feels like a horrible workaround :-( ... still tempting, but then other non-qt apps will still fail. So guess I'll just wait for a fixed Qt5)