[evolution/gnome-3-22] Bug 776224 - Workaround crash in WebKit on drag over preview



commit 4919461bafbd2a7bedb883a4700ec58b96208882
Author: Milan Crha <mcrha redhat com>
Date:   Tue Dec 20 15:08:16 2016 +0100

    Bug 776224 - Workaround crash in WebKit on drag over preview

 e-util/e-web-view.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index cd3633e..85f20ec 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -1267,9 +1267,34 @@ web_view_drag_motion (GtkWidget *widget,
                       gint y,
                       guint time_)
 {
+       /* Made this way to not pretend that this is a drop zone,
+          when only FALSE had been returned, even it is supposed
+          to be enough. Remove web_view_drag_leave() once fixed. */
+       gdk_drag_status (context, 0, time_);
+
+       return TRUE;
+}
+
+static gboolean
+web_view_drag_drop (GtkWidget *widget,
+                   GdkDragContext *context,
+                   gint x,
+                   gint y,
+                   guint time_)
+{
+       /* Defined to avoid crash in WebKit */
        return FALSE;
 }
 
+static void
+web_view_drag_leave (GtkWidget *widget,
+                    GdkDragContext *context,
+                    guint time_)
+{
+       /* Defined to avoid crash in WebKit, when the web_view_drag_motion()
+          uses the other way around. */
+}
+
 static GtkWidget *
 web_view_create_plugin_widget (EWebView *web_view,
                                const gchar *mime_type,
@@ -2089,6 +2114,8 @@ e_web_view_class_init (EWebViewClass *class)
        widget_class = GTK_WIDGET_CLASS (class);
        widget_class->scroll_event = web_view_scroll_event;
        widget_class->drag_motion = web_view_drag_motion;
+       widget_class->drag_drop = web_view_drag_drop;
+       widget_class->drag_leave = web_view_drag_leave;
        widget_class->map = web_view_map;
        widget_class->unmap = web_view_unmap;
 


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