File evolution-drag-text-to-composer.patch of Package evolution

diff -Npur evolution-3.10.4.bak/composer/e-msg-composer.c evolution-3.10.4/composer/e-msg-composer.c
--- evolution-3.10.4.bak/composer/e-msg-composer.c	2013-12-07 23:15:10.000000000 +0800
+++ evolution-3.10.4/composer/e-msg-composer.c	2014-09-03 08:35:37.909417686 +0800
@@ -1755,10 +1755,44 @@ msg_composer_drag_data_received_cb (GtkW
                                     EMsgComposer *composer)
 {
 	EAttachmentView *view;
+	GdkAtom atom;
+	gchar *name;
+
+	atom = gtk_selection_data_get_target (selection);
+	name = gdk_atom_name (atom);
+
+	if (g_strcmp0 (name, "UTF8_STRING") == 0 || g_strcmp0 (name, "text/plain") == 0 ||
+		g_strcmp0 (name, "text/html") == 0) {
+		const guchar *data;
+		gint length;
+		gint i;
+		gchar *text;
+		GString *buf;
+
+		data = gtk_selection_data_get_data (selection);
+		length = gtk_selection_data_get_length (selection);
+
+		if (!data || length < 0) {
+			g_free (name);
+			return;
+		}
+
+		buf = g_string_new (NULL);
+		for (i = 0; i < length; i++)
+			if (*(data +i) != '\0')
+				buf = g_string_append_c (buf, *(data + i));
+		gtkhtml_editor_insert_html (GTKHTML_EDITOR (composer), buf->str);
+
+		/* Stop the signal from propagating */
+		g_signal_stop_emission_by_name (widget, "drag-data-received");
+		g_string_free (buf, TRUE);
+		g_free (name);
+		return;
+	}
+	g_free (name);
 
 	/* HTML mode has a few special cases for drops... */
 	if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer))) {
-
 		/* If we're receiving an image, we want the image to be
 		 * inserted in the message body.  Let GtkHtml handle it. */
 		if (gtk_selection_data_targets_include_image (selection, TRUE))
openSUSE Build Service is sponsored by