evolution/0002-I-969-Workaround-freeze-on-drag-of-message-over-comp.patch
2020-06-23 13:22:24 -07:00

59 lines
1.9 KiB
Diff

From edfd6aa9b513c7347e930d44012c53123cf88a74 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 5 Jun 2020 13:40:41 +0200
Subject: [PATCH 2/5] I#969 - Workaround freeze on drag of message over
composer body
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/969
---
src/modules/webkit-editor/e-webkit-editor.c | 26 +++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/modules/webkit-editor/e-webkit-editor.c b/src/modules/webkit-editor/e-webkit-editor.c
index 304781d626..2a91782e41 100644
--- a/src/modules/webkit-editor/e-webkit-editor.c
+++ b/src/modules/webkit-editor/e-webkit-editor.c
@@ -5101,6 +5101,28 @@ webkit_editor_drag_leave_cb (EWebKitEditor *wk_editor,
g_signal_stop_emission_by_name (GTK_WIDGET (wk_editor), "drag-leave");
}
+static gboolean
+webkit_editor_drag_motion_cb (GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ guint time,
+ gpointer user_data)
+{
+ GdkAtom chosen;
+
+ chosen = gtk_drag_dest_find_target (widget, context, NULL);
+
+ /* This is when dragging message from the message list, which can eventually freeze
+ Evolution, if PDF file format is set, when processes by WebKitGTK itself. */
+ if (chosen != GDK_NONE && chosen == gdk_atom_intern ("x-uid-list", TRUE)) {
+ gdk_drag_status (context, GDK_ACTION_COPY, time);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static gboolean
webkit_editor_drag_drop_cb (EWebKitEditor *wk_editor,
GdkDragContext *context,
@@ -5533,6 +5555,10 @@ e_webkit_editor_init (EWebKitEditor *wk_editor)
wk_editor, "drag-drop",
G_CALLBACK (webkit_editor_drag_drop_cb), NULL);
+ g_signal_connect (
+ wk_editor, "drag-motion",
+ G_CALLBACK (webkit_editor_drag_motion_cb), NULL);
+
g_signal_connect (
wk_editor, "web-process-crashed",
G_CALLBACK (webkit_editor_web_process_crashed_cb), NULL);
--
2.27.0