After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 603031 - Copy/Paste doesn't work in some cases
Copy/Paste doesn't work in some cases
Status: RESOLVED OBSOLETE
Product: empathy
Classification: Core
Component: Chat
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
: 619199 621859 (view as bug list)
Depends on: 611642
Blocks:
 
 
Reported: 2009-11-26 11:13 UTC by Guillaume Desmottes
Modified: 2018-05-22 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/copy-paste-603031 fixes the first case. No idea how to solve the middle-click case. (1.49 KB, patch)
2009-11-26 11:53 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2009-11-26 11:13:00 UTC
bug #581488 improved the general copy/paste situation but it still doesn't work properly in some cases (using GTK+ themes):

Working:
- Copy using Ctrl+V
- Copy using the Edit - Copy menu

Not working:
- Copy using the popup menu when right clicking in the text view
- Copy by selecting the text and then pasting it using middle click
Comment 1 Guillaume Desmottes 2009-11-26 11:53:34 UTC
Created attachment 148523 [details] [review]
http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/copy-paste-603031 fixes the first case. No idea how to solve the middle-click case.

 libempathy-gtk/empathy-chat-text-view.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Comment 2 Xavier Claessens 2009-11-26 12:43:59 UTC
I don't understand what's the code-path when I do ctr-c/ctr-v. But your patch seems correct.

r+
Comment 3 Guillaume Desmottes 2009-11-26 14:39:23 UTC
I merged the branch; thanks.

Let's keep this bug open as the middle-click case is still broken.
Comment 4 Mike Ruprecht 2010-02-28 03:28:34 UTC
After some investigation, my understanding of the middle-click case is that it's due to GtkTextBuffer's clipboard_get_selection_cb function. In it, when pasting plain-text, it calls gtk_text_iter_get_visible text, which basically ignores all images and embedded objects. Only the text is pasted.

As far as I can tell, Gtk lacks any way of overriding this. It seems like it would make sense to be able to use gtk_text_buffer_register_serialize_format with a "text/plain" format in order to override this, but it doesn't currently do so.
Comment 5 Guillaume Desmottes 2010-03-02 10:30:34 UTC
Mike: Thanks for investigating this. Could you please open a GTK+ bug about this?
Comment 6 Mike Ruprecht 2010-03-02 22:27:39 UTC
GTK+ bug created as bug #611642
Comment 7 soloturn 2010-04-05 18:27:21 UTC
is this the reason why copy-paste works differently in pidgin and empathy as well? see ubuntu bugs https://bugs.edge.launchpad.net/ubuntu/+source/empathy/+bug/530222 e.g. 

with pidgin copy-paste looks the same everywhere. nicely formatted, with color and timestamp, one paragraph per message.

with empathy it does not, some examples:

1. copy multiple messages from one chat window - paste into another
the result is one big message, including all the messages as text. name and date coming with it.

2. copy multiple messages from one chat window - paste into openoffice
an ugly formatted (html?) table is produced, with dead icons.

3. copy multiple messages from one chat window - paste intogmail rich text formatted mail, firefox-3.6
no paste at all is possible.

4. copy multiple messages from one chat window - paste into text editor, or text formated gmail
the format is ugly and inconsistent, i.e. for a multiline message copied:
   * first line is name and time,
   * second line is only text
   * third line is text and time
   * fourth line is space
Comment 8 Guillaume Desmottes 2010-05-21 07:55:41 UTC
*** Bug 619199 has been marked as a duplicate of this bug. ***
Comment 9 Bilal Shahid 2012-02-23 18:25:17 UTC
i say that  https://bugzilla.gnome.org/show_bug.cgi?id=621859
is the dup of this one ?
Comment 10 Guillaume Desmottes 2012-02-24 09:51:52 UTC
*** Bug 621859 has been marked as a duplicate of this bug. ***
Comment 11 Guillaume Desmottes 2012-06-27 12:17:19 UTC
(In reply to comment #7)
> is this the reason why copy-paste works differently in pidgin and empathy as
> well? 

No, this bug is about not copying anything at all, not badly formated text being copied. See bug #678313 for that.
Comment 12 Guillaume Desmottes 2012-06-27 12:23:25 UTC
Let's consider only Adium chat themes, as they will be mandatory soon (bug #645921), so make sure your themes in Empathy preferences is not 'Classic', 'Blue', 'Clean'  or 'Simple'. The 'Ubuntu' theme is fine as it's in HTML.

I did some testing and the only case where we can't actually copy is when typing something in the chat window, selecting it and using Ctrl+C.

Is there more broken cases?
Comment 13 Guillaume Desmottes 2012-06-27 13:56:01 UTC
(In reply to comment #12)
> I did some testing and the only case where we can't actually copy is when
> typing something in the chat window, selecting it and using Ctrl+C.

It's actually:
- Select some text A in the chat view
- Type something in the input entry and select it (B)
- Hit Ctrl+C
- A is copied and not B
Comment 14 Guillaume Desmottes 2012-06-28 08:35:04 UTC
This seems to be because of a WebKitGtk bug: https://bugs.webkit.org/show_bug.cgi?id=90144
Comment 15 GNOME Infrastructure Team 2018-05-22 13:52:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/empathy/issues/149.