[evolution] I#969 - Workaround freeze on drag of message over composer body



commit 28fb2937e516578b2205c6170c9a7043b285924b
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 5 13:40:41 2020 +0200

    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 711acb6a3f..0ebbffd8e9 100644
--- a/src/modules/webkit-editor/e-webkit-editor.c
+++ b/src/modules/webkit-editor/e-webkit-editor.c
@@ -5152,6 +5152,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,
@@ -5594,6 +5616,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]