[Webkit-unassigned] [Bug 200297] [GTK] Cannot disable drag-and-drop functionality with gtk_drag_source_set()/gtk_drag_source_unset() inside a WebKitWebView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 1 04:05:22 PDT 2019


--- Comment #3 from Jussi <jussi.hietanen at iki.fi> ---
(In reply to Michael Catanzaro from comment #2)
> (In reply to Jussi from comment #0)
> > This should create a custom Gtk::TargetEntry list which is allowed to copy
> > data from the widget. However, after setting this drag_source_set(), the
> > program aborts because an assert fails in the
> > webkitWebViewBaseDragEnd(GtkWidget* widget, GdkDragContext* context)
> > function inside WebKitWebViewBase.cpp
> > (https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.25.1/
> > Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp#L1281). Seems like
> > calling "drag_source_set()" on a WebView nullifies some internal structure
> > (WebKitWebViewBasePrivate->dragAndDropHandler).
> Good bug report... I guess we didn't consider that applications could use
> these functions. Of course using GTK public APIs shouldn't cause WebKit to
> crash, so we'll need to reconsider these assertions.

Thanks, I was wondering whether this is a bug at all.. :-) Well, meanwhile I've come around the problem by just running the javascript code "document.addEventListener(\"dragstart\", function(evt) { evt.preventDefault(); });" after a page has loaded inside a WebView. But I would like to have a "proper" solution for the dragging issue.

> (In reply to Jussi from comment #1)
> > It seems like the same thing has been asked before, and the resolution to
> > the "bug" last time was to make WebView widget honour the
> > gtk-dnd-drag-threshold setting which can be set inside the widget's
> > GtkSettings struct.
> > 
> > The old bug can be found from: https://bugs.webkit.org/show_bug.cgi?id=64459
> > 
> > At least I cannot get it working with following code:
> > 
> > Glib::RefPtr<Gtk::Settings> settings = webWidget->get_settings();
> > settings->property_gtk_dnd_drag_threshold() = 100000;
> Well that old patch was never committed. The bug is still open.

Oh, my bad. It just came up when I was searching web for others having similar problems.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190801/666baa5b/attachment.html>

More information about the webkit-unassigned mailing list