Bug 218163

Summary: [GTK] drag-drop not received anymore
Product: WebKit Reporter: Sebastien <amarok>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: bandali, bugs-noreply, cgarcia, clopez
Priority: P3 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Sebastien 2020-10-25 13:13:34 PDT
Hi,

I currently develop an application with gtkwebkit. 2 years ago we add support for drag & dropping files into the webview, by connecting the webview with:

    g_signal_connect(priv->webview_chat, "drag-data-received", G_CALLBACK(webview_chat_on_drag_data_received), view);
    g_signal_connect(priv->webview_chat, "drag-drop", G_CALLBACK(webview_chat_on_drag_data), view);

On recent versions, this code is not working anymore for 2 reasons:

1. The drag&drop looks handled by the webview, and instead of launching drag-drop, the webview is loading the file, triggering "decide-policy" with WEBKIT_POLICY_DECISION_TYPE_RESPONSE
2. So "drag-drop" is not emitted, even if I do a             webkit_policy_decision_ignore(decision); for WEBKIT_POLICY_DECISION_TYPE_RESPONSE, and the decide-policy is only triggered once.

So, 2 possibillites:

+ Add a setting in WebkitSettings to avoid this behavior. I don't know when it was introduced, but 2 years ago it was not like this (http://www.manpagez.com/html/webkitgtk/webkitgtk-2.4.10/WebKitWebSettings.php)
This is what I use:

    WebKitSettings* webkit_settings = webkit_settings_new_with_settings(
        "enable-javascript", TRUE,
        "enable-developer-extras", priv->chatview_debug,
        "enable-java", FALSE,
        "enable-plugins", FALSE,
        "enable-site-specific-quirks", FALSE,
        "enable-smooth-scrolling", TRUE,
        NULL
    );



+ be able to connect "drag-drop"
Comment 1 Sebastien 2020-10-26 07:26:02 PDT
In fact it's definitely a very new bug.

I don't have the bug on Ubuntu 20.04 but present on Ubuntu 20.10, and same for Fedora, it's present on my fedora updated the last week-end, but not the one updated 2 months ago
Comment 2 Carlos Alberto Lopez Perez 2020-10-27 21:06:00 PDT
If you can translate versions of Ubuntu/Fedora to versions of WebKitGTK that would be helpful for WebKitGTK developers to understand easier when this new behavior was introduced

I understand Ubuntu-20.04 ships WebKitGTK 2.28.4 and Ubuntu-20.10 WebKitGTK 2.30.1

So the new behavior has started to happen between 2.28.4 and 2.30.1

is that right?
Comment 3 bandali 2020-11-02 06:37:49 PST
Hello,

(In reply to Carlos Alberto Lopez Perez from comment #2)
[...]
> 
> I understand Ubuntu-20.04 ships WebKitGTK 2.28.4 and Ubuntu-20.10 WebKitGTK
> 2.30.1
> 
> So the new behavior has started to happen between 2.28.4 and 2.30.1
> 
> is that right?

That seems to be the case indeed, and I observe the same issue on 2.30.1.
Comment 4 Carlos Garcia Campos 2020-11-06 01:00:18 PST

*** This bug has been marked as a duplicate of bug 218562 ***