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
This commit is contained in:
Federico Mena Quintero
2001-07-10 23:51:19 +00:00
committed by Federico Mena Quintero
parent e39d94c5ef
commit ee250cad8e
2 changed files with 30 additions and 3 deletions

View File

@ -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]

View File

@ -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;