Пример #1
0
static gint
e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter,
                            GdkEvent *event,
                            EMinicardView *view)
{
	GdkDragContext *context;
	GtkTargetList *target_list;
	GdkDragAction actions = GDK_ACTION_MOVE | GDK_ACTION_COPY;

	clear_drag_data (view);

	view->drag_list = e_minicard_view_get_card_list (view);

	target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types));

	context = gtk_drag_begin (
		GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas),
		target_list, actions, 1/*XXX */, event);

	if (!view->canvas_drag_data_get_id)
		view->canvas_drag_data_get_id = g_signal_connect (
			GNOME_CANVAS_ITEM (view)->canvas, "drag_data_get",
			G_CALLBACK (e_minicard_view_drag_data_get), view);

	gtk_drag_set_icon_default (context);

	return TRUE;
}
Пример #2
0
void DragAndDropHandler::startDrag(Ref<SelectionData>&& selection, DragOperation dragOperation, RefPtr<ShareableBitmap>&& dragImage)
{
#if GTK_CHECK_VERSION(3, 16, 0)
    m_draggingSelectionData = WTFMove(selection);
    GRefPtr<GtkTargetList> targetList = PasteboardHelper::singleton().targetListForSelectionData(*m_draggingSelectionData);
#else
    RefPtr<SelectionData> selectionData = WTFMove(selection);
    GRefPtr<GtkTargetList> targetList = PasteboardHelper::singleton().targetListForSelectionData(*selectionData);
#endif

    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());
    GdkDragContext* context = gtk_drag_begin(m_page.viewWidget(), targetList.get(), dragOperationToGdkDragActions(dragOperation),
        GDK_BUTTON_PRIMARY, currentEvent.get());

#if GTK_CHECK_VERSION(3, 16, 0)
    // WebCore::EventHandler does not support more than one DnD operation at the same time for
    // a given page, so we should cancel any previous operation whose context we might have
    // stored, should we receive a new startDrag event before finishing a previous DnD operation.
    if (m_dragContext)
        gtk_drag_cancel(m_dragContext.get());
    m_dragContext = context;
#else
    // We don't have gtk_drag_cancel() in GTK+ < 3.16, so we use the old code.
    // See https://bugs.webkit.org/show_bug.cgi?id=138468
    m_draggingSelectionDataMap.set(context, WTFMove(selectionData));
#endif

    if (dragImage) {
        RefPtr<cairo_surface_t> image(dragImage->createCairoSurface());
        // Use the center of the drag image as hotspot.
        cairo_surface_set_device_offset(image.get(), -cairo_image_surface_get_width(image.get()) / 2, -cairo_image_surface_get_height(image.get()) / 2);
        gtk_drag_set_icon_surface(context, image.get());
    } else
        gtk_drag_set_icon_default(context);
}
Пример #3
0
static gint __gevasevh_group_selector_leave_notify_cb(
    GtkWidget          *widget,
    GdkEventCrossing   *event,
    GtkgEvasEvHGroupSelector* ev
    )
{
/*
  printf("__gevasevh_group_selector_leave_notify_cb() w:%p event:%p ev:%p gevas:%p gwin:%d\n",
           widget, event, ev,
           GTK_WIDGET (ev->rect->gevas),
           GTK_WIDGET_NO_WINDOW(GTK_WIDGET (ev->rect->gevas))
        );
*/
    
    if( ev->drag_targets && ev->drag_is_dragging )
    {
        ev->drag_context = gtk_drag_begin (GTK_WIDGET (ev->rect->gevas),
                                           ev->drag_targets,
                                           GDK_ACTION_MOVE | GDK_ACTION_COPY,
                                           1, (GdkEvent*)event);
        gtk_drag_set_icon_default (ev->drag_context);
/*        printf("__gevasevh_group_selector_leave_notify_cb() context:%p\n",ev->drag_context);*/
        
    }

    return 0;
    
}
Пример #4
0
NS_IMETHODIMP
nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
                                 nsISupportsArray * aArrayTransferables,
                                 nsIScriptableRegion * aRegion,
                                 PRUint32 aActionType)
{
    PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::InvokeDragSession"));
    nsresult rv = nsBaseDragService::InvokeDragSession(aDOMNode,
                                                       aArrayTransferables,
                                                       aRegion, aActionType);
    NS_ENSURE_SUCCESS(rv, rv);

    // make sure that we have an array of transferables to use
    if (!aArrayTransferables)
        return NS_ERROR_INVALID_ARG;
    // set our reference to the transferables.  this will also addref
    // the transferables since we're going to hang onto this beyond the
    // length of this call
    mSourceDataItems = aArrayTransferables;
    // get the list of items we offer for drags
    GtkTargetList *sourceList = 0;

    sourceList = GetSourceList();

    if (sourceList) {
        // save our action type
        GdkDragAction action = GDK_ACTION_DEFAULT;

        if (aActionType & DRAGDROP_ACTION_COPY)
            action = (GdkDragAction)(action | GDK_ACTION_COPY);
        if (aActionType & DRAGDROP_ACTION_MOVE)
            action = (GdkDragAction)(action | GDK_ACTION_MOVE);
        if (aActionType & DRAGDROP_ACTION_LINK)
            action = (GdkDragAction)(action | GDK_ACTION_LINK);

        // Create a fake event for the drag so we can pass the time
        // (so to speak.)  If we don't do this the drag can end as a
        // result of a button release that is actually _earlier_ than
        // CurrentTime.  So we use the time on the last button press
        // event, as that will always be older than the button release
        // that ends any drag.
        GdkEvent event;
        memset(&event, 0, sizeof(GdkEvent));
        event.type = GDK_BUTTON_PRESS;
        event.button.window = mHiddenWidget->window;
        event.button.time = nsWindow::mLastButtonPressTime;

        // start our drag.
        GdkDragContext *context = gtk_drag_begin(mHiddenWidget,
                                                 sourceList,
                                                 action,
                                                 1,
                                                 &event);
        // make sure to set our default icon
        gtk_drag_set_icon_default(context);
        gtk_target_list_unref(sourceList);
    }

    return NS_OK;
}
Пример #5
0
static void
egg_tree_multi_drag_begin (GtkWidget *tree,
                           GdkDragContext *context,
                           gpointer user_data)
{
  gtk_drag_set_icon_default (context);
  g_signal_stop_emission_by_name (tree, "drag-begin");
}
Пример #6
0
void Ctrl::GtkDragBegin(GtkWidget *widget, GdkDragContext *context, gpointer user_data)
{
	if(IsNull(dnd_icon))
    	gtk_drag_set_icon_default(context);
	else {
		ImageGdk m(dnd_icon);
		gtk_drag_set_icon_pixbuf(context, m, 0, 0);
	}
	LLOG("GtkDragBegin");
}
Пример #7
0
static gboolean
egg_tree_multi_drag_motion_event (GtkWidget      *widget,
				  GdkEventMotion *event,
				  gpointer        data)
{
  EggTreeMultiDndData *priv_data;

  priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING);

  if (gtk_drag_check_threshold (widget,
				priv_data->x,
				priv_data->y,
				event->x,
				event->y))
    {
      GList *path_list = NULL;
      GtkTreeSelection *selection;
      GtkTreeModel *model;
      GdkDragContext *context;
      TreeViewDragInfo *di;

      di = get_info (GTK_TREE_VIEW (widget));

      if (di == NULL)
	return FALSE;
      
      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
      stop_drag_check (widget);
      gtk_tree_selection_selected_foreach (selection, selection_foreach, &path_list);
      path_list = g_list_reverse (path_list);
      model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
      if (egg_tree_multi_drag_source_row_draggable (EGG_TREE_MULTI_DRAG_SOURCE (model), path_list))
	{

	  context = gtk_drag_begin (widget,
#if GTK_CHECK_VERSION (2, 14, 0)
                                    gtk_drag_source_get_target_list (widget),
#else
				    di->source_target_list,
#endif
				    di->source_actions,
				    priv_data->pressed_button,
				    (GdkEvent*)event);
	  set_context_data (context, path_list);
	  gtk_drag_set_icon_default (context);

	}
      else
	{
	  path_list_free (path_list);
	}
    }

  return TRUE;
}
Пример #8
0
static gboolean
egg_tree_multi_drag_motion_event (GtkWidget      *widget,
				  GdkEventMotion *event,
				  gpointer        data)
{
  EggTreeMultiDndData *priv_data;

  priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING);

  if (gtk_drag_check_threshold (widget,
				priv_data->x,
				priv_data->y,
				event->x,
				event->y))
    {
      GList            *path_list = NULL;
      GtkTreeSelection *selection;
      GtkTreeModel     *model;
      GdkDragContext   *context;

      stop_drag_check (widget);

      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
      gtk_tree_selection_selected_foreach (selection, selection_foreach, &path_list);
      if (path_list == NULL)
	      return FALSE;

      path_list = g_list_reverse (path_list);

      model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
      if (egg_tree_multi_drag_source_row_draggable (EGG_TREE_MULTI_DRAG_SOURCE (model), path_list))
	{
	  GtkTargetList *target_list = gtk_target_list_new (target_table,
							    G_N_ELEMENTS (target_table));

	  context = gtk_drag_begin (widget,
				    target_list,
				    GDK_ACTION_COPY,
				    priv_data->pressed_button,
				    (GdkEvent*)event);
	  set_context_data (context, path_list);
	  gtk_drag_set_icon_default (context);

	  gtk_target_list_unref (target_list);
	}
      else
	{
	  path_list_free (path_list);
	}
    }

  return TRUE;
}
Пример #9
0
int
clip_GTK_DRAGSETICONDEFAULT(ClipMachine * cm)
{
        C_object *ccontext = _fetch_co_arg(cm);

	if (!ccontext || ccontext->type != GDK_TYPE_DRAG_CONTEXT)
        	goto err;

        gtk_drag_set_icon_default((GdkDragContext*)ccontext->object);

	return 0;
err:
	return 1;
}
Пример #10
0
static void mimeview_start_drag(GtkWidget *widget, gint button,
				GdkEvent *event, MimeView *mimeview)
{
	GdkDragContext *context;
	MimeInfo *partinfo;

	g_return_if_fail(mimeview != NULL);

	partinfo = mimeview_get_selected_part(mimeview);
	if (partinfo->disposition == DISPOSITIONTYPE_INLINE) return;

	context = gtk_drag_begin(widget, mimeview->target_list,
				 GDK_ACTION_COPY, button, event);
	gtk_drag_set_icon_default(context);
}
Пример #11
0
static void
on_drag_begin ( GtkWidget *src_widget,
				GdkDragContext *drag_context,
				FmDndSrc* ds )
{
	/* block default handler */

    gtk_drag_set_icon_default( drag_context );

	/* FIXME: set the icon to file icon later */
	// gtk_drag_set_icon_pixbuf();

	/* ask drag source to provide list of source files. */
	g_signal_emit(ds, signals[DATA_GET], 0);
}
Пример #12
0
void DragAndDropHandler::startDrag(const DragData& dragData, PassRefPtr<ShareableBitmap> dragImage)
{
    RefPtr<DataObjectGtk> dataObject = adoptRef(dragData.platformData());
    GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());

    GdkDragContext* context = gtk_drag_begin(m_page.viewWidget(), targetList.get(), dragOperationToGdkDragActions(dragData.draggingSourceOperationMask()),
        GDK_BUTTON_PRIMARY, currentEvent.get());
    m_draggingDataObjects.set(context, dataObject.get());

    if (dragImage) {
        RefPtr<cairo_surface_t> image(dragImage->createCairoSurface());
        m_dragIcon.setImage(image.get());
        m_dragIcon.useForDrag(context);
    } else
        gtk_drag_set_icon_default(context);
}
Пример #13
0
static void
mouse_click_cb(GtkWidget *widget, GdkEventButton *event, FileView *view)
{
  if (event->button == 1)
  { /* Left Button: selection */
    if (curr_view != view)
    {
      switch_views();
      gtk_widget_grab_focus(view->clist);
    }
  }
  else if (event->button == 2)
  { /* Middle Button: Drag and Drop */
    GtkTargetList *list;
    GdkDragContext *context;

    list = gtk_target_list_new(target_table, n_targets);
    context = gtk_drag_begin(curr_view->clist, list, GDK_ACTION_COPY |
      GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK,
      event->button, (GdkEvent *)event);
    gtk_drag_set_icon_default(context);
  }
  else if (event->button == 3)
  { /* Right Button: Menu */
    if (cfg.windows_right_click && (view->tagged == NULL))
    { /* if windows right click is enabled, we want to select the file */
      gint xmouse,ymouse,row,column;
      GdkModifierType mask;

      gdk_window_get_pointer(GTK_CLIST(view->clist)->clist_window,
                             &xmouse, &ymouse, &mask);
      gtk_clist_get_selection_info(GTK_CLIST(view->clist), xmouse, ymouse,
                                   &row, &column);
      /* don't screw up the current selection */
      if (!clist_row_is_selected(view->clist, row))
        gtk_clist_unselect_all(GTK_CLIST(view->clist));
      focus_row(view, row, FALSE, FALSE, TRUE);
    }

    if (event->state & GDK_CONTROL_MASK)
      show_user_command_menu(event->button, event->time);
    else
      show_menu(event->button, event->time);
  }
}
Пример #14
0
void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame* frame, bool linkDrag)
{
    Element* targetElement = frame->document()->elementFromPoint(m_startPos.x(), m_startPos.y());
    bool imageDrag = false;

    if (targetElement)
        imageDrag = targetElement->renderer()->isImage();

    GdkAtom textHtml = gdk_atom_intern_static_string("text/html");
    GdkAtom netscapeUrl = gdk_atom_intern_static_string("_NETSCAPE_URL");

    GtkTargetList* targetList = gtk_target_list_new(NULL, 0);
    gtk_target_list_add(targetList, textHtml, 0, WEBKIT_WEB_VIEW_TARGET_INFO_HTML);
    gtk_target_list_add_text_targets(targetList, WEBKIT_WEB_VIEW_TARGET_INFO_TEXT);

    if (linkDrag || imageDrag) {
        gtk_target_list_add(targetList, netscapeUrl, 0, WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL);
        gtk_target_list_add_uri_targets(targetList, WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST);
    }

    if (imageDrag)
        gtk_target_list_add_image_targets(targetList, WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE, false);

    GdkDragAction dragAction = GDK_ACTION_COPY;
    if (linkDrag) {
        dragAction = GDK_ACTION_LINK;
        if (imageDrag)
            dragAction = (GdkDragAction)(dragAction | GDK_ACTION_COPY);
    }

    GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS);
    reinterpret_cast<GdkEventButton*>(event)->window = gtk_widget_get_window(GTK_WIDGET(m_webView));
    reinterpret_cast<GdkEventButton*>(event)->time = GDK_CURRENT_TIME;

    GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView),
                                             targetList, dragAction, 1, event);
    g_object_ref(context);

    if (image)
        gtk_drag_set_icon_pixbuf(context, image, eventPos.x() - dragImageOrigin.x(), eventPos.y() - dragImageOrigin.y());
    else
        gtk_drag_set_icon_default(context);

    gtk_target_list_unref(targetList);
}
static gboolean
rb_tree_dnd_motion_notify_event_cb (GtkWidget      *widget,
				     GdkEventMotion *event,
                 		     gpointer        data)
{
	RbTreeDndData *priv_data;

	priv_data = g_object_get_data (G_OBJECT (widget), RB_TREE_DND_STRING);

	if (gtk_drag_check_threshold (widget,
				      priv_data->x,
				      priv_data->y,
				      event->x,
				      event->y))
	{
		GList *path_list = NULL;
		GtkTreeSelection *selection;
		GtkTreeModel *model;
		GdkDragContext *context;

		selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
		stop_drag_check (widget);
		gtk_tree_selection_selected_foreach (selection, selection_foreach, &path_list);
		path_list = g_list_reverse (path_list);
		model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));

		if (rb_tree_drag_source_row_draggable (RB_TREE_DRAG_SOURCE (model), path_list))
		{
			rb_debug ("drag begin");
			context = gtk_drag_begin (widget,
						  priv_data->source_target_list,
						  priv_data->source_actions,
						  priv_data->pressed_button,
						  (GdkEvent*)event);
	  		set_context_data (context, path_list);
	  		gtk_drag_set_icon_default (context);

		} else {
			path_list_free (path_list);
		}
	}

	return TRUE;
}
Пример #16
0
static gboolean
on_motion_event( GtkWidget *widget, GdkEventMotion *event, EggTreeMultiDragSource *drag_source )
{
	EggTreeMultiDndData *priv_data;

	priv_data = g_object_get_data( G_OBJECT( widget ), EGG_TREE_MULTI_DND_STRING );

	if( gtk_drag_check_threshold( widget, priv_data->x, priv_data->y, event->x, event->y )){

		GList            *path_list = NULL;
		GtkTreeSelection *selection;
		GtkTreeModel     *model;
		GdkDragContext   *context;

		stop_drag_check( widget );

		selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ));
		gtk_tree_selection_selected_foreach( selection, ( GtkTreeSelectionForeachFunc ) selection_foreach, &path_list );
		path_list = g_list_reverse( path_list );

		model = gtk_tree_view_get_model( GTK_TREE_VIEW( widget ));

		if( egg_tree_multi_drag_source_row_draggable( EGG_TREE_MULTI_DRAG_SOURCE( model ), path_list )){

			GtkTargetList *target_list = v_get_target_list( drag_source );
			GdkDragAction actions = v_get_drag_actions( drag_source );

			context = gtk_drag_begin(
					widget, target_list, actions, priv_data->pressed_button, ( GdkEvent * ) event );

			set_treeview_data( widget, path_list );

			gtk_drag_set_icon_default( context );

			v_free_target_list( drag_source, target_list );

		} else {
			path_list_free( path_list );
		}
	}

	return( TRUE );
}
Пример #17
0
void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard* clipboard, Frame* frame, bool linkDrag)
{
    WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame));
    RefPtr<DataObjectGtk> dataObject = clipboard->pasteboard().dataObject();
    GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
    GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event());

    GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get());
    webView->priv->dragAndDropHelper.startedDrag(context, dataObject.get());

    // A drag starting should prevent a double-click from happening. This might
    // happen if a drag is followed very quickly by another click (like in the DRT).
    webView->priv->clickCounter.reset();

    if (image) {
        m_dragIcon.setImage(image);
        m_dragIcon.useForDrag(context, IntPoint(eventPos - dragImageOrigin));
    } else
        gtk_drag_set_icon_default(context);
}
Пример #18
0
static gboolean
motion_notify_cb (GtkWidget *widget,
		  GdkEventMotion *event,
		  EphyNodeView *view)
{
	GdkDragContext *context;
	GList *ref_list;

	if (event->window != gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget)))
	{
		return FALSE;
	}
	if (view->priv->drag_button != 0)
	{
		if (gtk_drag_check_threshold (widget, view->priv->drag_x,
					      view->priv->drag_y, event->x,
					      event->y)
		    && can_drag_selection (view))
		{
			context = gtk_drag_begin
				(widget, view->priv->source_target_list,
				 GDK_ACTION_ASK | GDK_ACTION_COPY | GDK_ACTION_LINK,
				 view->priv->drag_button,
				 (GdkEvent*)event);

			stop_drag_check (view);
			view->priv->drag_started = TRUE;

			ref_list = get_selection_refs (GTK_TREE_VIEW (widget));
			g_object_set_data_full (G_OBJECT (context),
						"drag-info",
						ref_list,
						(GDestroyNotify)ref_list_free);

			gtk_drag_set_icon_default (context);
		}
	}

	return TRUE;
}
Пример #19
0
static void mimeview_drag_begin(GtkWidget *widget, GdkDragContext *drag_context,
				MimeView *mimeview)
{
	gchar *filename;
	gchar *bname = NULL;
	MimeInfo *partinfo;

	if (!mimeview->opened) return;
	if (!mimeview->messageview->file) return;

	partinfo = mimeview_get_selected_part(mimeview);
	if (!partinfo) return;

	filename = partinfo->filename ? partinfo->filename : partinfo->name;
	if (filename) {
		const gchar *bname_;

		bname_ = g_basename(filename);
		bname = conv_filename_from_utf8(bname_);
		subst_for_filename(bname);
	}
	if (!bname || *bname == '\0')
		filename = procmime_get_tmp_file_name(partinfo);
	else
		filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,
				       bname, NULL);

	if (procmime_get_part(filename, mimeview->messageview->file, partinfo) < 0) {
		g_warning(_("Can't save the part of multipart message."));
	} else
		mimeview->drag_file = encode_uri(filename);

	g_free(filename);

	gtk_drag_set_icon_default(drag_context);
}
Пример #20
0
static VALUE
rg_m_set_icon_default(VALUE self, VALUE context)
{
    gtk_drag_set_icon_default(RVAL2DC(context));
    return self;
}
Пример #21
0
static gboolean
egg_tree_multi_drag_motion_event (GtkWidget      *widget,
				  GdkEventMotion *event,
				  gpointer        data)
{
  EggTreeMultiDndData *priv_data;

  priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING);

  if (! priv_data->pending_event)
    return FALSE;

  if (gtk_drag_check_threshold (widget,
				priv_data->x,
				priv_data->y,
				event->x,
				event->y))
    {
      GList            *path_list = NULL;
      GtkTreeSelection *selection;
      GtkTreeModel     *model;
      GdkDragContext   *context;

      stop_drag_check (widget);

      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
      gtk_tree_selection_selected_foreach (selection, selection_foreach, &path_list);
      if (path_list == NULL)
	      return FALSE;

      path_list = g_list_reverse (path_list);

      model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
      if (egg_tree_multi_drag_source_row_draggable (EGG_TREE_MULTI_DRAG_SOURCE (model), path_list))
	{
	  GtkTargetList *target_list;
	  GtkTreePath   *tree_path;
	  int            cell_x;
	  int            cell_y;

	  target_list = gtk_target_list_new (target_table, G_N_ELEMENTS (target_table));
	  context = gtk_drag_begin_with_coordinates (widget,
			  	  	  	     target_list,
			  	  	  	     GDK_ACTION_COPY,
			  	  	  	     priv_data->pressed_button,
			  	  	  	     (GdkEvent*) event,
			  	  	  	     event->x,
			  	  	  	     event->y);
	  set_context_data (context, path_list);

	  if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
					     priv_data->x,
					     priv_data->y,
					     &tree_path,
					     NULL,
					     &cell_x,
					     &cell_y))
	  {
		  cairo_surface_t *drag_icon;

		  drag_icon = gtk_tree_view_create_row_drag_icon (GTK_TREE_VIEW (widget), tree_path);

		  if (path_list->next != NULL) {

			  /* create a multi row drag icon */

			  const int        icon_offset = DRAG_ICON_OFFSET;
			  GdkRectangle     icon_extents;
			  cairo_surface_t *multi_drag_icon;
			  cairo_t         *cr;
			  int              n_icons, i, offset;

			  n_icons = MIN (DRAG_ICON_MAX_ROWS, g_list_length (path_list));
			  _gtk_cairo_surface_extents (drag_icon, &icon_extents);

			  multi_drag_icon = gdk_window_create_similar_surface (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget)),
									       CAIRO_CONTENT_COLOR_ALPHA,
									       icon_extents.width + (icon_offset * (n_icons - 1)),
									       icon_extents.height + (icon_offset * (n_icons - 1)));

			  cr = cairo_create (multi_drag_icon);

			  cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
			  cairo_rectangle(cr, 0, 0, icon_extents.width + icon_offset, icon_extents.height + icon_offset);
			  cairo_fill (cr);

			  offset = icon_offset * (n_icons - 1);
			  for (i = 0; i < n_icons; i++) {
				  cairo_set_source_surface (cr, drag_icon, -icon_extents.x + offset, -icon_extents.y + offset);
				  cairo_rectangle (cr, offset, offset, icon_extents.width, icon_extents.height);
				  cairo_fill (cr);
				  offset -= icon_offset;
			  }

			  cairo_destroy (cr);

			  cairo_surface_set_device_offset (multi_drag_icon, - (cell_x + 1), - (cell_y + 1));
			  gtk_drag_set_icon_surface (context, multi_drag_icon);

			  cairo_surface_destroy (multi_drag_icon);
		  }
		  else {
			  cairo_surface_set_device_offset (drag_icon, - (cell_x + 1), - (cell_y + 1));
			  gtk_drag_set_icon_surface (context, drag_icon);
		  }

		  cairo_surface_destroy (drag_icon);
		  gtk_tree_path_free (tree_path);
	  }
	  else
		  gtk_drag_set_icon_default (context);

	  gtk_target_list_unref (target_list);
	}
      else
	{
	  path_list_free (path_list);
	}
    }

  return TRUE;
}