aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-28 21:23:48 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-28 21:23:48 +0800
commit91a0c4fcb278477422e1c89f517cc0f5c833de33 (patch)
tree3428584c0e65213b9fec107aa2726aaafa3e0987 /libempathy-gtk
parent10de0a21f8abf9ad1719039addf347e03a6324dd (diff)
parent01566e5ee1cc585aeda44f58d76874ac1faaa63a (diff)
downloadgsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.tar
gsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.tar.gz
gsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.tar.bz2
gsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.tar.lz
gsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.tar.xz
gsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.tar.zst
gsoc2013-empathy-91a0c4fcb278477422e1c89f517cc0f5c833de33.zip
Merge remote branch 'vminko/fix-612205-v2'
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index d6b9cf788..e946ae57f 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -3385,6 +3385,31 @@ empathy_chat_copy (EmpathyChat *chat)
gtk_text_buffer_copy_clipboard (buffer, clipboard);
}
+ else {
+ gint start_offset;
+ gint end_offset;
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+
+ if (gtk_label_get_selection_bounds (GTK_LABEL (priv->label_topic),
+ &start_offset,
+ &end_offset)) {
+ gchar *start;
+ gchar *end;
+ gchar *selection;
+ const gchar *topic;
+ GtkClipboard *clipboard;
+
+ topic = gtk_label_get_text (GTK_LABEL (priv->label_topic));
+ start = g_utf8_offset_to_pointer (topic, start_offset);
+ end = g_utf8_offset_to_pointer (topic, end_offset);
+ selection = g_strndup (start, end - start);
+
+ clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+ gtk_clipboard_set_text (clipboard, selection, -1);
+
+ g_free (selection);
+ }
+ }
}
void