Bug 85456 - Klipper does not retain non-text selections when the source application exits
Summary: Klipper does not retain non-text selections when the source application exits
Status: RESOLVED WORKSFORME
Alias: None
Product: klipper
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-19 03:45 UTC by Clarence Dang
Modified: 2021-04-01 21:05 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clarence Dang 2004-07-19 03:45:52 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

even if "Prevent empty clipboard" is on.

To reproduce:
1. open KolourPaint
2. draw something
3. select it and Edit/Copy
4. exit KolourPaint
5. bring up a new KolourPaint and Edit/Paste

You either get nothing or text (I'm guessing it's the last text entry in the klipper history).  Either way, QImageDrag::decode() returns false on QApplication::clipboard ()->data (QClipboard::Clipboard).
Comment 1 Esben Mose Hansen 2004-11-20 21:33:58 UTC
Yes, the "prevent empty clipboard" only works for text. I'm changing this, but it'll be a while before it is complete. You are in luck though: Image support is high on my list :)
Comment 2 Esben Mose Hansen 2004-11-22 22:20:26 UTC
Well, the commit I'm going to make adds support in Klipper for images. But KolourPaint does not handle this well at all for some reason. The ancient KPaint have no trouble, except discovering that the clipboard actually contains an image, so I know that Klipper correctly sets an image, but KoulourPaint just pastes some text instead.

Some day, copy&pasting images in Linux will just work. Some day :)

This bug will stay open until I am reasonable sure that "prevent empty clipboard" works for all applications --- as seen from Klipper's point of view.
Comment 3 Clarence Dang 2004-11-23 10:47:31 UTC
On Tue, 23 Nov 2004 08:20 am, Esben Mose Hansen wrote:
> Well, the commit I'm going to make adds support in Klipper for
> images. 
Could you please let me know after you've done the commit?

> The ancient KPaint have no trouble, except discovering that the clipboard
> actually contains an image, 
If KPaint doesn't realise that there isn't an image in the clipboard, how does 
KPaint paste it!?

> so I know that Klipper correctly sets an image,
> but KoulourPaint just pastes some text instead.
That meant that KolourPaint couldn't see the image in the clipboard.

If you could set DEBUG_KP_SELECTION_DRAG to 1 in 
kdegraphics/kolourpaint/kpselectiondrag.cpp and send me the debug output, 
that would be great.  Else, I'll debug it when I have time (and when HEAD 
actually compiles :)).

> Some day, copy&pasting images in Linux will just work. Some day :)
BTW, if you could add "Copy" to the image RMB menu in KHTML, that would be 
great.


Comment 4 Esben Mose Hansen 2004-11-26 18:37:49 UTC
Nailed the thing about Kolourpaint. It turned out that Klipper could not set a image clipitem unless the item already in the clipboard was also an image item.  It's fixed now in CVS. (toplevel version 1.167)

Comment 5 Clarence Dang 2004-11-26 23:35:18 UTC
On Fri, 26 Nov 2004 05:37 pm, Esben Mose Hansen wrote:
> Nailed the thing about Kolourpaint. It turned out that Klipper
> could not set a image clipitem unless the item already in the clipboard was
> also an image item.  It's fixed now in CVS. (toplevel version 1.167)

Great :)  Does this handle "application/x-kolourpaint-selection" data as well 
(or any other application specific clipboard data)?

Comment 6 Esben Mose Hansen 2004-11-27 08:43:49 UTC
No, it only handles the image types and text. When it handles the rest, I'll close this bug :)
Comment 7 Lubos Lunak 2006-01-31 16:53:08 UTC
See also http://freedesktop.org/wiki/ClipboardManager .
Comment 8 karaluh 2009-03-16 15:37:10 UTC
What's the progress?
Comment 9 Esben Mose Hansen 2009-03-16 16:03:21 UTC
The support for images was added, but removed again due to various problems. I can't recall the exact details, sorry.
Comment 10 karaluh 2009-08-11 14:00:19 UTC
Any plans to reimplement it?
Comment 11 Esben Mose Hansen 2009-08-11 14:27:27 UTC
As far as I am aware, not in the short term
Comment 12 Esben Mose Hansen 2009-09-22 15:54:02 UTC
If you deselect "ignore images", does klipper do what you want?
Comment 13 noric 2015-09-28 11:16:34 UTC
By unchecking "Ignore images" it works, as reported in the post above mine.
Comment 14 Justin Zobel 2021-03-16 07:57:32 UTC
Even after many moons, this is still an issue, needs investigating.
Comment 15 Nate Graham 2021-04-01 20:39:52 UTC
The solution is to uncheck "Ignore images". Without that, Klipper is simple doing what you tell it: ignoring images. So when you copy the image, it's getting ignored by Klipper and instead placed on the internal X11 clipboard, which clears itself automatically when the source app quits. If you want image data to be retained across app launched, you need to use Klipper for image pastes, which is accomplished by unchecking the "Ignore Images" checkbox.

The question of whether this is a good default setting or not is another matter, of course. :)