Bug 218163
| Summary: | [GTK] drag-drop not received anymore | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sebastien <amarok> |
| Component: | WebKitGTK | Assignee: | 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 | ||
Sebastien
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"
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sebastien
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
Carlos Alberto Lopez Perez
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?
bandali
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.
Carlos Garcia Campos
*** This bug has been marked as a duplicate of bug 218562 ***