summaryrefslogtreecommitdiffstats
path: root/views/widget/widget_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/widget/widget_gtk.cc')
-rw-r--r--views/widget/widget_gtk.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index cfd9a44..de5b43e 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -184,10 +184,23 @@ void WidgetGtk::DoDrag(const OSExchangeData& data, int operation) {
GtkTargetList* targets = data_provider.GetTargetList();
GdkEvent* current_event = gtk_get_current_event();
DCHECK(current_event);
- gtk_drag_begin(window_contents_, targets,
- static_cast<GdkDragAction>(
- DragDropTypes::DragOperationToGdkDragAction(operation)),
- 1, current_event);
+ const OSExchangeDataProviderGtk& provider(
+ static_cast<const OSExchangeDataProviderGtk&>(data.provider()));
+
+ GdkDragContext* context = gtk_drag_begin(
+ window_contents_,
+ targets,
+ static_cast<GdkDragAction>(
+ DragDropTypes::DragOperationToGdkDragAction(operation)),
+ 1,
+ current_event);
+
+ // Set the drag image if one was supplied.
+ if (provider.drag_image())
+ gtk_drag_set_icon_pixbuf(context,
+ provider.drag_image(),
+ provider.cursor_offset_x(),
+ provider.cursor_offset_y());
gdk_event_free(current_event);
gtk_target_list_unref(targets);