Пример #1
0
static gboolean
gth_file_list_drag_drop (GtkWidget      *widget,
			 GdkDragContext *context,
			 gint            x,
			 gint            y,
			 guint           time,
			 gpointer        user_data)
{
	GthBrowser *browser = user_data;
	int         filename_len;
	char       *filename;

	g_signal_stop_emission_by_name (widget, "drag-drop");

	if (gdk_property_get (gdk_drag_context_get_source_window (context),
			      XDND_ACTION_DIRECT_SAVE_ATOM,
			      TEXT_PLAIN_ATOM,
			      0,
			      1024,
			      FALSE,
			      NULL,
			      NULL,
			      &filename_len,
			      (guchar **) &filename)
	    && GTH_IS_FILE_SOURCE_VFS (gth_browser_get_location_source (browser)))
	{
		GFile *file;
		char  *uri;

		filename = g_realloc (filename, filename_len + 1);
		filename[filename_len] = '\0';

		file = _g_file_append_path (gth_browser_get_location (browser), filename);
		uri = g_file_get_uri (file);
		gdk_property_change (gdk_drag_context_get_source_window (context),
				     XDND_ACTION_DIRECT_SAVE_ATOM,
				     TEXT_PLAIN_ATOM,
				     8,
				     GDK_PROP_MODE_REPLACE,
				     (const guchar *) uri,
				     strlen (uri));

		g_free (uri);
		g_object_unref (file);
		g_free (filename);

		gtk_drag_get_data (widget,
		                   context,
		                   XDND_ACTION_DIRECT_SAVE_ATOM,
		                   time);
	}
	else
		gtk_drag_get_data (widget,
				   context,
				   URI_LIST_ATOM,
				   time);

	return TRUE;
}
Пример #2
0
int
clip_GTK_DRAGGETDATA(ClipMachine * cm)
{
        C_widget     *cwid = _fetch_cw_arg(cm);
        C_object *ccontext = _fetch_cobject(cm, _clip_spar(cm, 2));
        C_object    *catom = _fetch_cobject(cm, _clip_spar(cm, 3));
        guint32       time = _clip_parni(cm, 4);

	if (!ccontext || ccontext->type != GDK_TYPE_DRAG_CONTEXT)
        	goto err;
	CHECKCWID(cwid, GTK_IS_WIDGET);
	if (!catom || catom->type != GDK_TYPE_ATOM)
        	goto err;
	CHECKARG(4, NUMERIC_t);

        gtk_drag_get_data(GTK_WIDGET(cwid->widget),
        	(GdkDragContext*)ccontext->object,
                (GdkAtom)(catom->object),
                time);


	return 0;
err:
	return 1;
}
static gboolean
image_drag_drop_cb (GtkWidget *widget,
		    GdkDragContext *context,
		    gint x, gint y, guint time, EImageChooser *chooser)
{
	GList *p;

	if (!chooser->priv->editable)
		return FALSE;

	if (context->targets == NULL) {
		return FALSE;
	}

	for (p = context->targets; p != NULL; p = p->next) {
		char *possible_type;

		possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
		if (!strcmp (possible_type, URI_LIST_TYPE)) {
			g_free (possible_type);
			gtk_drag_get_data (widget, context,
					   GDK_POINTER_TO_ATOM (p->data),
					   time);
			return TRUE;
		}

		g_free (possible_type);
	}

	return FALSE;
}
Пример #4
0
static gboolean
interactive_canvas_drag_motion (GtkWidget      *widget,
                                GdkDragContext *context,
                                gint            x,
                                gint            y,
                                guint           time,
                                gpointer        data)
{
  if (drop_item)
    {
      /* already have a drop indicator - just update position */

      drop_item->x = x;
      drop_item->y = y;

      gtk_widget_queue_draw (widget);
      gdk_drag_status (context, GDK_ACTION_COPY, time);
    }
  else
    {
      /* request DnD data for creating a drop indicator */

      GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);

      if (!target)
        return FALSE;

      gtk_drag_get_data (widget, context, target, time);
    }

  return TRUE;
}
Пример #5
0
gboolean
contact_list_editor_drag_drop_cb (GtkWidget *widget,
                                  GdkDragContext *context,
                                  gint x, gint y,
                                  guint time)
{
	EContactListEditor *editor;
	GList *iter;

	editor = contact_list_editor_extract (widget);

	for (iter = context->targets; iter != NULL; iter = iter->next) {
		GdkAtom target = GDK_POINTER_TO_ATOM (iter->data);
		gchar *possible_type;
		gboolean match;

		possible_type = gdk_atom_name (target);
		match = (strcmp (possible_type, VCARD_TYPE) == 0);
		g_free (possible_type);

		if (match) {
			gtk_drag_get_data (widget, context, target, time);
			return TRUE;
		}
	}

	return FALSE;
}
static gboolean
get_drag_data (NautilusTreeViewDragDest *dest,
               GdkDragContext *context,
               guint32 time)
{
    GdkAtom target;

    target = gtk_drag_dest_find_target (GTK_WIDGET (dest->details->tree_view),
                                        context,
                                        NULL);

    if (target == GDK_NONE) {
        return FALSE;
    }

    if (target == gdk_atom_intern (NAUTILUS_ICON_DND_XDNDDIRECTSAVE_TYPE, FALSE) &&
            !dest->details->drop_occurred) {
        dest->details->drag_type = NAUTILUS_ICON_DND_XDNDDIRECTSAVE;
        dest->details->have_drag_data = TRUE;
        return TRUE;
    }

    gtk_drag_get_data (GTK_WIDGET (dest->details->tree_view),
                       context, target, time);

    return TRUE;
}
Пример #7
0
static gboolean
avatar_chooser_drag_drop_cb (GtkWidget          *widget,
			    GdkDragContext     *context,
			    gint                x,
			    gint                y,
			    guint               time,
			    EmpathyAvatarChooser *chooser)
{
	EmpathyAvatarChooserPriv *priv;
	GList                  *p;

	priv = GET_PRIV (chooser);

	if (context->targets == NULL) {
		return FALSE;
	}

	for (p = context->targets; p != NULL; p = p->next) {
		char *possible_type;

		possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
		if (!strcmp (possible_type, URI_LIST_TYPE)) {
			g_free (possible_type);
			gtk_drag_get_data (widget, context,
					   GDK_POINTER_TO_ATOM (p->data),
					   time);

			return TRUE;
		}

		g_free (possible_type);
	}

	return FALSE;
}
Пример #8
0
static gboolean
gstyle_color_widget_on_drag_drop (GtkWidget        *widget,
                                  GdkDragContext   *context,
                                  gint              x,
                                  gint              y,
                                  guint             time)
{
  GstyleColorWidget *self = (GstyleColorWidget *)widget;
  GdkAtom target;

  g_assert (GSTYLE_IS_COLOR_WIDGET (self));
  g_assert (GDK_IS_DRAG_CONTEXT (context));

  target = gtk_drag_dest_find_target (widget, context, NULL);
  if ((target == gdk_atom_intern_static_string ("GSTYLE_COLOR_WIDGET") ||
       target == gdk_atom_intern_static_string ("application/x-color") ||
       gtk_targets_include_text (&target, 1)) &&
      is_in_drop_zone (self, x, y))
    {
      gtk_drag_get_data (widget, context, target, time);
      return TRUE;
    }

  return FALSE;
}
Пример #9
0
gboolean
on_extensions_view_drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time)
{
	/* Iterate through the list of target types provided by the source */
	GdkAtom target_type = NULL;
	GList *iter;
	for(iter = gdk_drag_context_list_targets(drag_context); iter != NULL; iter = g_list_next(iter)) {
		gchar *type_name = gdk_atom_name(GDK_POINTER_TO_ATOM(iter->data));
		/* Select 'text/uri-list' from the list of available targets */
		if(!strcmp(type_name, "text/uri-list")) {
			g_free(type_name);
			target_type = GDK_POINTER_TO_ATOM(iter->data);
			break;
		}
		g_free(type_name);
	}
	/* If URI list not supported, then cancel */
	if(!target_type)
		return FALSE;

	/* Request the data from the source. */
	gtk_drag_get_data(
	  widget,         /* this widget, which will get 'drag-data-received' */
	  drag_context,   /* represents the current state of the DnD */
	  target_type,    /* the target type we want */
	  time);            /* time stamp */
	return TRUE;
}
Пример #10
0
/* Emitted when the user releases (drops) the selection. It should check that
 * the drop is over a valid part of the widget (if its a complex widget), and
 * itself to return true if the operation should continue. Next choose the
 * target type it wishes to ask the source for. Finally call gtk_drag_get_data
 * which will emit "drag-data-get" on the source. */
static gboolean drag_drop_handler(GtkWidget *widget, GdkDragContext *context, 
    gint x, gint y, guint time, gpointer user_data)
{
    GdkAtom target_type;
    GList *targets = gdk_drag_context_list_targets(context);

    DBG(("drag_drop_handler"));

    /* If the source offers a target */
    if (targets) {
        /* Choose the best target type */
        target_type = GDK_POINTER_TO_ATOM(g_list_nth_data (targets, TARGET_STRING));

        dropdata = 1;
        /* Request the data from the source. */
        gtk_drag_get_data(
            widget,         /* will receive 'drag-data-received' signal */
            context,        /* represents the current state of the DnD */
            target_type,    /* the target type we want */
            time            /* time stamp */
        );
        return TRUE;
    }
    /* No target offered by source => error */
    return FALSE;
}
Пример #11
0
static VALUE
rg_m_get_data(VALUE self, VALUE widget, VALUE context, VALUE target, VALUE time)
{
    gtk_drag_get_data(RVAL2WIDGET(widget), RVAL2DC(context), RVAL2ATOM(target),
                      NUM2UINT(time));
    return self;
}
Пример #12
0
static void queryNewDropContextData(DroppingContext* dropContext, GtkWidget* widget, guint time)
{
    GdkDragContext* gdkContext = dropContext->gdkContext;
    Vector<GdkAtom> acceptableTargets(PasteboardHelper::defaultPasteboardHelper()->dropAtomsForContext(widget, gdkContext));
    dropContext->pendingDataRequests = acceptableTargets.size();
    for (size_t i = 0; i < acceptableTargets.size(); i++)
        gtk_drag_get_data(widget, gdkContext, acceptableTargets.at(i), time);
}
static gboolean dnd_drop (GtkWidget * widget, GdkDragContext * context, gint x, gint y, guint time, AudioModulePanel * action) {
	GdkAtom target_type;
	action -> not_ready_for_drop = false;
	if (context -> targets) {
		target_type = GDK_POINTER_TO_ATOM (g_list_nth_data (context -> targets, 0));
		gtk_drag_get_data (widget, context, target_type, time);
	} else return FALSE;
	return TRUE;
}
Пример #14
0
gboolean receive_drag(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data)
{
	GtkTargetList *TL = gtk_target_list_new(target_table,1);
	GdkAtom target = gtk_drag_dest_find_target(widget,drag_context,TL);
	GtkWidget *srcWidget = gtk_drag_get_source_widget(drag_context);
	if (target == GDK_NONE || srcWidget == NULL)
		return FALSE;
	gtk_drag_get_data(srcWidget,drag_context,target,time);
	gtk_widget_queue_draw(widget);
	return TRUE;
}
Пример #15
0
/**
 * dnd_clarity_drag_drop:
 *
 * Used by the drag and drop of a jpg. When a drop is
 * made, this determines whether the drop is valid
 * then requests the data from the source widget.
 *
 */
gboolean dnd_clarity_drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data) {
    GdkAtom target;
    target = gtk_drag_dest_find_target(widget, drag_context, NULL);

    if (target != GDK_NONE) {
        gtk_drag_get_data(widget, drag_context, target, time);
        return TRUE;
    }

    return FALSE;
}
gboolean
gimp_container_tree_view_drag_drop (GtkWidget             *widget,
                                    GdkDragContext        *context,
                                    gint                   x,
                                    gint                   y,
                                    guint                  time,
                                    GimpContainerTreeView *tree_view)
{
  GimpDndType              src_type;
  GimpViewable            *src_viewable;
  GimpViewable            *dest_viewable;
  GdkAtom                  target;
  GtkTreeViewDropPosition  drop_pos;

  if (tree_view->priv->scroll_timeout_id)
    {
      g_source_remove (tree_view->priv->scroll_timeout_id);
      tree_view->priv->scroll_timeout_id = 0;
    }

  if (gimp_container_tree_view_drop_status (tree_view,
                                            context, x, y, time,
                                            NULL, &target, &src_type,
                                            &src_viewable,
                                            &dest_viewable, &drop_pos))
    {
      GimpContainerTreeViewClass *tree_view_class;

      tree_view_class = GIMP_CONTAINER_TREE_VIEW_GET_CLASS (tree_view);

      if (src_viewable)
        {
          gboolean success = TRUE;

          /* XXX: Make GimpContainerTreeViewClass::drop_viewable()
           * return success?
           */
          tree_view_class->drop_viewable (tree_view, src_viewable,
                                          dest_viewable, drop_pos);

          gtk_drag_finish (context, success, FALSE, time);
        }
      else
        {
          gtk_drag_get_data (widget, context, target, time);
        }

      return TRUE;
    }

  return FALSE;
}
Пример #17
0
/* FIXME bugzilla.gnome.org 47445: Needs to become a shared function */
static void
get_data_on_first_target_we_support (GtkWidget *widget, GdkDragContext *context, guint32 time, int x, int y)
{
	GtkTargetList *list;
	GdkAtom target;

	if (drop_types_list == NULL) {
		drop_types_list = gtk_target_list_new (drop_types,
						       G_N_ELEMENTS (drop_types) - 1);
		gtk_target_list_add_text_targets (drop_types_list, NEMO_ICON_DND_TEXT);
	}
	if (drop_types_list_root == NULL) {
		drop_types_list_root = gtk_target_list_new (drop_types,
							    G_N_ELEMENTS (drop_types));
		gtk_target_list_add_text_targets (drop_types_list_root, NEMO_ICON_DND_TEXT);
	}
	
	if (nemo_icon_container_get_is_desktop (NEMO_ICON_CONTAINER (widget))) {
		list = drop_types_list_root;
	} else {
		list = drop_types_list;
	}

	target = gtk_drag_dest_find_target (widget, context, list);
	if (target != GDK_NONE) {
		guint info;
		NemoDragInfo *drag_info;
		gboolean found;

		drag_info = &(NEMO_ICON_CONTAINER (widget)->details->dnd_info->drag_info);

		found = gtk_target_list_find (list, target, &info);
		g_assert (found);

		/* Don't get_data for destructive ops */
		if ((info == NEMO_ICON_DND_ROOTWINDOW_DROP ||
		     info == NEMO_ICON_DND_XDNDDIRECTSAVE) &&
		    !drag_info->drop_occured) {
			/* We can't call get_data here, because that would
			   make the source execute the rootwin action or the direct save */
			drag_info->got_drop_data_type = TRUE;
			drag_info->data_type = info;
		} else {
			if (info == NEMO_ICON_DND_XDNDDIRECTSAVE) {
				set_direct_save_uri (widget, context, drag_info, x, y);
			}
			gtk_drag_get_data (GTK_WIDGET (widget), context,
					   target, time);
		}
	}
}
Пример #18
0
static void
get_drag_data (EphyNodeView *view,
	       GdkDragContext *context, 
	       guint32 time)
{
	GdkAtom target;
	
	target = gtk_drag_dest_find_target (GTK_WIDGET (view), 
					    context, 
					    NULL);

	gtk_drag_get_data (GTK_WIDGET (view),
			   context, target, time);
}
static gboolean
rb_tree_dnd_drag_drop_cb (GtkWidget        *widget,
                         GdkDragContext   *context,
                         gint              x,
                         gint              y,
                         guint             time)
{
	GtkTreeView *tree_view;
	GtkTreePath *path;
	GtkTreeModel *model;
	GtkTreeViewDropPosition pos;
	RbTreeDndData *priv_data;

	tree_view = GTK_TREE_VIEW (widget);
	model = gtk_tree_view_get_model (tree_view);
	priv_data = g_object_get_data (G_OBJECT (widget), RB_TREE_DND_STRING);
	gtk_tree_view_get_dest_row_at_pos (tree_view, x, y, &path, &pos);

	remove_scroll_timeout (tree_view);

	/* Unset this thing */
	gtk_tree_view_set_drag_dest_row (tree_view,
               				 NULL,
					 GTK_TREE_VIEW_DROP_BEFORE);

	if (path || priv_data->dest_flags & RB_TREE_DEST_EMPTY_VIEW_DROP) {

		GdkAtom target;
		RbTreeDragDestIface *iface = RB_TREE_DRAG_DEST_GET_IFACE (model);
		if (iface->rb_get_drag_target) {
			RbTreeDragDest *dest = RB_TREE_DRAG_DEST (model);
			target = (* iface->rb_get_drag_target) (dest, widget, 
								context, path, 
								priv_data->dest_target_list);
		} else {
			target = gtk_drag_dest_find_target (widget, context, 
							    priv_data->dest_target_list);
		}

		if (path)
			gtk_tree_path_free (path);

		if (target != GDK_NONE) {
			gtk_drag_get_data (widget, context, target, time);
			return TRUE;
		}
	}

	return FALSE;
}
Пример #20
0
inline static
gboolean cache_src_file_infos(FmDndDest* dd, GtkWidget *dest_widget,
                        gint x, gint y, GdkDragContext *drag_context)
{
    GdkAtom target;
    target = gtk_drag_dest_find_target( dest_widget, drag_context, NULL );
    if( target != GDK_NONE )
    {
        GdkDragAction action;
        gboolean ret;
        /* treat X direct save as a special case. */
        if( target == gdk_atom_intern_static_string("XdndDirectSave0") )
        {
            /* FIXME: need a better way to handle this. */
            action = drag_context->suggested_action;
            g_signal_emit(dd, signals[QUERY_INFO], 0, x, y, &action, &ret);

            gdk_drag_status(drag_context, action, time);
            return TRUE;
        }

        /* g_debug("try to cache src_files"); */
        dd->mainloop = g_main_loop_new(NULL, TRUE);
        gtk_drag_get_data(dest_widget, drag_context, target, time);
        /* run the main loop to block here waiting for
         * 'drag-data-received' signal being handled first. */
        /* it's possible that g_main_loop_quit is called before we really run the loop. */
        if(g_main_loop_is_running(dd->mainloop))
            g_main_loop_run(dd->mainloop);
        g_main_loop_unref(dd->mainloop);
        dd->mainloop = NULL;
        /* g_debug("src_files cached: %p", dd->src_files); */

        /* dd->src_files should be set now */
        if( dd->src_files && fm_list_is_file_info_list(dd->src_files) )
        {
            /* cache file system id of source files */
            if( fm_file_info_list_is_same_fs(dd->src_files) )
            {
                FmFileInfo* fi = (FmFileInfo*)fm_list_peek_head(dd->src_files);
                if(fm_path_is_native(fi->path))
                    dd->src_dev = fi->dev;
                else
                    dd->src_fs_id = fi->fs_id;
            }
        }
    }
    return FALSE;
}
Пример #21
0
gboolean on_dir_tree_view_drag_drop ( GtkWidget *widget,
                                    GdkDragContext *drag_context,
                                    gint x,
                                    gint y,
                                    guint time,
                                    PtkFileBrowser* file_browser )  //MOD added
{
    GdkAtom target = gdk_atom_intern( "text/uri-list", FALSE );

    /*  Don't call the default handler  */
    g_signal_stop_emission_by_name( widget, "drag-drop" );

    gtk_drag_get_data ( widget, drag_context, target, time );
    return TRUE;
}
Пример #22
0
static gboolean
on_drag_drop (GtkWidget *widget,
			  GdkDragContext *context,
			  gint x, gint y,
			  guint time, gpointer data)
{
	GtkTargetList *target_list = gtk_target_list_new (targets, n_targets);
	GdkAtom atom = gtk_drag_dest_find_target (widget, context, target_list);

	if (atom == GDK_NONE)
		return FALSE;

	gtk_drag_get_data (widget, context, atom, time);
	gtk_target_list_unref (target_list);
	return TRUE;
}
Пример #23
0
static gboolean
on_log_pane_drag_drop (GtkWidget *widget, GdkDragContext *context, 
                       gint x, gint y, guint time,
                       GitLogPane *self)
{
	GdkAtom target_type;

	target_type = gtk_drag_dest_find_target (widget, context, NULL);

	if (target_type != GDK_NONE)
		gtk_drag_get_data (widget, context, target_type, time);
	else
		gtk_drag_finish (context, FALSE, FALSE, time);

	return TRUE;
}
Пример #24
0
static gboolean
drag_drop_cb (GtkWidget	        *widget,
	      GdkDragContext    *context,
	      gint               x,
	      gint               y,
	      guint              time,
	      Launcher          *launcher)
{
	GdkAtom ret_atom = NULL;

	if (!panel_check_dnd_target_data (widget, context, NULL, &ret_atom))
		return FALSE;

	gtk_drag_get_data (widget, context, ret_atom, time);

	return TRUE;
}
Пример #25
0
static gboolean
drag_drop_cb (GtkWidget      *widget,
              GdkDragContext *context,
              int             x,
              int             y,
              guint           time_,
              Drawer         *drawer)
{
    GdkAtom atom = NULL;

    if (!panel_check_dnd_target_data (widget, context, NULL, &atom))
        return FALSE;

    gtk_drag_get_data (widget, context, atom, time_);

    return TRUE;
}
Пример #26
0
static gboolean
interactive_canvas_drag_drop (GtkWidget      *widget,
                              GdkDragContext *context,
                              gint            x,
                              gint            y,
                              guint           time,
                              gpointer        data)
{
  GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);

  if (!target)
    return FALSE;

  drag_data_requested_for_drop = TRUE;
  gtk_drag_get_data (widget, context, target, time);

  return FALSE;
}
Пример #27
0
static gboolean
toolbar_drag_drop_cb (GtkToolbar         *toolbar,
		      GdkDragContext     *context,
		      gint                x,
		      gint                y,
		      guint               time,
		      EggEditableToolbar *etoolbar)
{
  GdkAtom target;

  target = gtk_drag_dest_find_target (GTK_WIDGET (toolbar), context, NULL);
  if (target != GDK_NONE)
    {
      gtk_drag_get_data (GTK_WIDGET (toolbar), context, target, time);
      return TRUE;
    }

  return FALSE;
}
Пример #28
0
String Ctrl::DragGet(const char *fmt)
{
	LLOG("DragGet " << fmt << " " << (Ctrl::dnd_targets.Find(fmt) >= 0));
	if(Ctrl::dnd_targets.Find(fmt) < 0)
		return Null;
	dnd_data.Clear();
	dnd_data_wait = true;
	dnd_data_fmt = fmt;
	int t0 = msecs();
	gtk_drag_get_data(dnd_widget, dnd_context,
	                  GAtom(strcmp(fmt, "image") == 0 ? ~dnd_image_target :
	                        strcmp(fmt, "text") == 0 ? ~dnd_text_target :
	                        strcmp(fmt, "files") == 0 ? ~dnd_files_target : fmt),
	                  dnd_time);
	while(msecs() - t0 < 1000 && dnd_data_wait)
		FetchEvents(true);
	LLOG("DragGet data length " << dnd_data.GetLength());
	return dnd_data;
}
Пример #29
0
static gboolean
drag_drop_cb (GtkWidget	        *widget,
	      GdkDragContext    *context,
	      gint               x,
	      gint               y,
	      guint              time,
	      Launcher          *launcher)
{
	static GdkAtom text_uri_list = NULL;

	if ( ! is_this_drop_ok (widget, context))
		return FALSE;

	if (text_uri_list == NULL)
		text_uri_list = gdk_atom_intern_static_string ("text/uri-list");

	gtk_drag_get_data (widget, context, text_uri_list, time);

	return TRUE;
}
Пример #30
0
DataObjectGtk* DragAndDropHandler::requestDragData(GdkDragContext* context, const IntPoint& position, unsigned time)
{
    std::unique_ptr<DroppingContext>& droppingContext = m_droppingContexts.add(context, nullptr).iterator->value;
    if (!droppingContext) {
        GtkWidget* widget = m_page.viewWidget();
        droppingContext = std::make_unique<DroppingContext>(context, position);
        Vector<GdkAtom> acceptableTargets(PasteboardHelper::defaultPasteboardHelper()->dropAtomsForContext(widget, droppingContext->gdkContext));
        droppingContext->pendingDataRequests = acceptableTargets.size();
        for (auto& target : acceptableTargets)
            gtk_drag_get_data(widget, droppingContext->gdkContext, target, time);
    } else
        droppingContext->lastMotionPosition = position;

    // Don't send any drag information to WebCore until we've retrieved all the data for this drag operation.
    // Otherwise we'd have to block to wait for the drag's data.
    if (droppingContext->pendingDataRequests > 0)
        return nullptr;

    return droppingContext->dataObject.get();
}