aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-07-11 07:51:19 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-07-11 07:51:19 +0800
commitee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2 (patch)
tree88c69fa8748b0faf439f545887dff37883a9c972 /mail
parente39d94c5ef8d88c726a29f2cfa994a6a0d90be5a (diff)
downloadgsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.tar
gsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.tar.gz
gsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.tar.bz2
gsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.tar.lz
gsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.tar.xz
gsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.tar.zst
gsoc2013-evolution-ee250cad8e32e0aaa9d9a57c4154ea7728b7c4f2.zip
Set the CLIPBOARD selection as well as the primary selection so that
2001-07-10 Federico Mena Quintero <federico@ximian.com> * mail-display.c (link_copy_location): Set the CLIPBOARD selection as well as the primary selection so that Edit/Paste will work in other programs (e.g. Netscape). (mail_display_new): Add the target for the CLIPBOARD selection. svn path=/trunk/; revision=10977
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/mail-display.c26
2 files changed, 30 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e88fc24b30..1f7a598314 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-10 Federico Mena Quintero <federico@ximian.com>
+
+ * mail-display.c (link_copy_location): Set the CLIPBOARD
+ selection as well as the primary selection so that Edit/Paste will
+ work in other programs (e.g. Netscape).
+ (mail_display_new): Add the target for the CLIPBOARD selection.
+
2001-07-10 Jason Leach <jleach@ximian.com>
[Bug #4305: Make the automatic mark-as-read timer optional]
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 00212c8868..5edc1242a5 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -1359,11 +1359,25 @@ link_save_as (GtkWidget *w, MailDisplay *mail_display)
static void
link_copy_location (GtkWidget *w, MailDisplay *mail_display)
{
+ GdkAtom clipboard_atom;
+
g_free (mail_display->selection);
mail_display->selection = g_strdup (mail_display->html->pointer_url);
-
- if (! gtk_selection_owner_set (GTK_WIDGET (mail_display->invisible), GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME))
- g_warning ("Damn");
+
+ clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+ if (clipboard_atom == GDK_NONE)
+ return; /* failed */
+
+ /* We don't check the return values of the following since there is not
+ * much we can do if we cannot assert the selection.
+ */
+
+ gtk_selection_owner_set (GTK_WIDGET (mail_display->invisible),
+ GDK_SELECTION_PRIMARY,
+ GDK_CURRENT_TIME);
+ gtk_selection_owner_set (GTK_WIDGET (mail_display->invisible),
+ clipboard_atom,
+ GDK_CURRENT_TIME);
}
static void
@@ -1831,6 +1845,7 @@ mail_display_new (void)
{
MailDisplay *mail_display = gtk_type_new (mail_display_get_type ());
GtkWidget *scroll, *html;
+ GdkAtom clipboard_atom;
gtk_box_set_homogeneous (GTK_BOX (mail_display), FALSE);
gtk_widget_show (GTK_WIDGET (mail_display));
@@ -1880,6 +1895,11 @@ mail_display_new (void)
gtk_selection_add_target (mail_display->invisible,
GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1);
+ clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+ if (clipboard_atom != GDK_NONE)
+ gtk_selection_add_target (mail_display->invisible,
+ clipboard_atom, GDK_SELECTION_TYPE_STRING, 1);
+
mail_display->scroll = E_SCROLL_FRAME (scroll);
mail_display->html = GTK_HTML (html);
mail_display->stream = NULL;