Bug 452271 - The "Ignore images" option is ignored when copying an image from Spectacle
Summary: The "Ignore images" option is ignored when copying an image from Spectacle
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (other bugs)
Version First Reported In: 5.24.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-04 19:45 UTC by popov895
Modified: 2022-04-05 18:13 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Entry with the copied image, but without preview (10.97 KB, image/png)
2022-04-04 19:47 UTC, popov895
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2022-04-04 19:45:43 UTC
SUMMARY

Even if the "Ignore images" option is enabled, copying an image to the clipboard creates a new entry in the Clipboard applet (but without a preview).

SOFTWARE/OS VERSIONS

Operating System: KDE neon 5.24
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Graphics Platform: X11
Comment 1 popov895 2022-04-04 19:47:51 UTC
Created attachment 147964 [details]
Entry with the copied image, but without preview
Comment 2 David Edmundson 2022-04-04 20:32:35 UTC
Where are you copying from?
Comment 3 popov895 2022-04-04 21:24:34 UTC
(In reply to David Edmundson from comment #2)
> Where are you copying from?

Take a screenshot with Spectacle and click "Copy to Clipboard" or open the image with Kolourpaint and copy it to clipboard.
Comment 4 Nate Graham 2022-04-04 21:38:01 UTC
IIRC spectacle always ignores the "ignore images" setting, since otherwise its copy to clipboard" setting would be quite broken, and we got bug reports about that.

I don't really get the point of this "ignore images" setting in the first place and have long supported removing it.
Comment 5 popov895 2022-04-04 22:06:25 UTC
"Ignore images" is an option of the Clipboard applet and I don't understand what Spectacle has to do with it. Does it have to take into account the settings of the Clipboard applet? In my understanding, enabling the "Ignore images" option means that the Clipboard applet will only remember non-image data, while the clipboard itself can still contain any type of data (including images) without restriction.
Comment 6 David Edmundson 2022-04-04 23:04:45 UTC
>In my understanding, enabling the "Ignore images" option means that the Clipboard applet will only remember non-image data, while the clipboard itself can still contain any type of data (including images) without restriction.

That's absolutely spot on.

However, because spectacle had a mode to take a picture copy to the clipboard and exit it was decided somewhere that klipper should special case it and deliberately ignore the setting. 

The UI is misleading and confusing, but it is working as intended.
Comment 7 David Edmundson 2022-04-04 23:06:59 UTC
>I don't really get the point of this "ignore images" setting in the first place and have long supported removing it.

Most of the time klipper is pointless. It's only useful if the app closes. For text, copying is relatively fast so it's worth it.
For images, that's not the case. We're using up a lot of memory and a lot of overhead for something the user probably doesn't want.
Comment 8 popov895 2022-04-05 08:34:08 UTC
Ah, now I figured it out. Yes, this only happens if I use "Copy to Clipboard" in the Spectacle, there is no such problem with Kolourpaint.

Surprisingly, but in Ubuntu, using the default GNOME screenshot app, I can take a screenshot, copy it to the clipboard, close the app, open the drawing app, and paste the image from the clipboard. And it works!

Maybe we should implement Freedesktop's ClipboardManager specification (https://freedesktop.org/wiki/ClipboardManager/) for this? Sorry if this is a stupid assumption, I'm not qualified in this field.
Comment 9 David Edmundson 2022-04-05 09:18:53 UTC
Maybe.

Qt has some code handling save_targets from the client side on exit if a clipboardmanager exists. We do get in that path if xclipboard is running. So we would just need the klipper side. I'm unsure how feasible implementation is without duplicating half of qxclipboard.

We also need to think about how a wayland equivalent would work. We don't want x11 only features at this point.
Comment 10 Nate Graham 2022-04-05 18:13:05 UTC
OK, so this behaves as intended, within the current technical and design constraints.

Let's get a new bug report to request porting to https://freedesktop.org/wiki/ClipboardManager/, if that's something that we feel might make sense.