Changeset 269505 in webkit


Ignore:
Timestamp:
Nov 6, 2020 1:09:31 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Application cannot override drag&drop callbacks
https://bugs.webkit.org/show_bug.cgi?id=218562

Patch by Milan Crha <mcrha@redhat.com> on 2020-11-06
Reviewed by Michael Catanzaro.

  • UIProcess/API/gtk/DropTargetGtk3.cpp:

(WebKit::DropTarget::DropTarget): Use g_signal_connect_after(), thus
any descendants can override the callbacks.
(WebKit::DropTarget::didPerformAction): Always call gdk_drag_status(),
to have gtk+ notified about drag progress.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r269504 r269505  
     12020-11-06  Milan Crha  <mcrha@redhat.com>
     2
     3        [GTK] Application cannot override drag&drop callbacks
     4        https://bugs.webkit.org/show_bug.cgi?id=218562
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * UIProcess/API/gtk/DropTargetGtk3.cpp:
     9        (WebKit::DropTarget::DropTarget): Use g_signal_connect_after(), thus
     10        any descendants can override the callbacks.
     11        (WebKit::DropTarget::didPerformAction): Always call gdk_drag_status(),
     12        to have gtk+ notified about drag progress.
     13
    1142020-11-06  Michael Catanzaro  <mcatanzaro@gnome.org>
    215
  • trunk/Source/WebKit/UIProcess/API/gtk/DropTargetGtk3.cpp

    r265756 r269505  
    5757    gtk_drag_dest_set_target_list(m_webView, list.get());
    5858
    59     g_signal_connect(m_webView, "drag-motion", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, gint x, gint y, guint time, gpointer userData) -> gboolean {
    60         auto& drop = *static_cast<DropTarget*>(userData);
    61         if (!drop.m_drop) {
     59    g_signal_connect_after(m_webView, "drag-motion", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, gint x, gint y, guint time, gpointer userData) -> gboolean {
     60        auto& drop = *static_cast<DropTarget*>(userData);
     61        if (drop.m_drop != context) {
    6262            drop.m_drop = context;
    6363            drop.m_position = IntPoint(x, y);
     
    6868    }), this);
    6969
    70     g_signal_connect(m_webView, "drag-leave", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, guint time, gpointer userData) {
     70    g_signal_connect_after(m_webView, "drag-leave", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, guint time, gpointer userData) {
    7171        auto& drop = *static_cast<DropTarget*>(userData);
    7272        if (drop.m_drop != context)
     
    7575    }), this);
    7676
    77     g_signal_connect(m_webView, "drag-drop", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, gint x, gint y, guint time, gpointer userData) -> gboolean {
     77    g_signal_connect_after(m_webView, "drag-drop", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, gint x, gint y, guint time, gpointer userData) -> gboolean {
    7878        auto& drop = *static_cast<DropTarget*>(userData);
    7979        if (drop.m_drop != context) {
     
    8585    }), this);
    8686
    87     g_signal_connect(m_webView, "drag-data-received", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint info, guint time, gpointer userData) {
     87    g_signal_connect_after(m_webView, "drag-data-received", G_CALLBACK(+[](GtkWidget*, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint info, guint time, gpointer userData) {
    8888        auto& drop = *static_cast<DropTarget*>(userData);
    8989        if (drop.m_drop != context)
     
    231231    ASSERT(page);
    232232
    233     auto operation = page->currentDragOperation();
    234     if (operation == m_operation)
    235         return;
    236 
    237     m_operation = operation;
     233    m_operation = page->currentDragOperation();
     234
    238235    gdk_drag_status(m_drop.get(), dragOperationToSingleGdkDragAction(m_operation), GDK_CURRENT_TIME);
    239236}
Note: See TracChangeset for help on using the changeset viewer.