aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Minko <vitaly.minko@gmail.com>2010-10-28 20:52:16 +0800
committerVitaly Minko <vitaly.minko@gmail.com>2010-10-28 20:52:16 +0800
commit01566e5ee1cc585aeda44f58d76874ac1faaa63a (patch)
treeb15c564ed9f2aa356216bda34d16ae298f5c2800
parent8fcbe3e7f71eeb6bca559dd6c36711b7fa5078c4 (diff)
downloadgsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.tar
gsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.tar.gz
gsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.tar.bz2
gsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.tar.lz
gsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.tar.xz
gsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.tar.zst
gsoc2013-empathy-01566e5ee1cc585aeda44f58d76874ac1faaa63a.zip
Copy topic selection manually since Ctrl-C is bound to the menu item.
-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