[webkit-gtk] how to disable drag in webkit ?

arno arno at renevier.net
Mon Jul 11 02:29:18 PDT 2011

Le mardi 28 juin 2011, à 08:45:46 -0700, Martin a écrit : 
> On Tue, Jun 28, 2011 at 8:16 AM, arno <arno at renevier.net> wrote:
> > I'd like to disable drag and drop in webkit, but failed to see how I could
> > accomplish that. Is it possible ?
> You can likely do this by intercepting drag-and-drop related signals
> happening on the WebView widget.
> --Martin

Thanks for your answer.  But unfortunately, I did not succeed.

My best result is connecting to drag-data-get, and calling gdk_drag_abort from 
handler. That way, I can prevent data from being dropped into webview. For 
example, if I drag text from a <div> into an <input>, the text is not dropped 
into the input. But that does not prevent drag from starting. 

calling gdk_drag_abort from drag-begin handler seems to have no effect at all.

I also succeeded in preventing drop by calling gtk_drag_source_unset(webview) 
instead of connecting to signals. But still no way to prevent drag start.


More information about the webkit-gtk mailing list