summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-05-29 14:36:03 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-05-29 14:36:03 +0000
commitc906acd0868da4e82bcc8e9e463905f1b35ce8e7 (patch)
tree812766e6cf39c1a72c2cbac2163e87a20a33413a /gtk
parentbdff7cdb1aae7d55bbd883a036e646c7d5389966 (diff)
downloadgtk+-c906acd0868da4e82bcc8e9e463905f1b35ce8e7.tar.gz
Merged from stable.
Thu May 29 16:31:34 2003 Kristian Rietveld <kris@gtk.org> Merged from stable. * gtk/gtktreeview.c (gtk_tree_view_maybe_begin_dragging_row), (gtk_tree_view_drag_begin): set the DnD icon in _drag_begin instead of _maybe_begin_dragging_row, so the icon can be overridden by apps. (Fixes #104374, patch from Daniel Elstner).
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktreeview.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 03fedd9201..0c474a3e0c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5131,25 +5131,6 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view,
button,
(GdkEvent*)event);
- gtk_drag_set_icon_default (context);
-
- {
- GdkPixmap *row_pix;
-
- row_pix = gtk_tree_view_create_row_drag_icon (tree_view,
- path);
-
- gtk_drag_set_icon_pixmap (context,
- gdk_drawable_get_colormap (row_pix),
- row_pix,
- NULL,
- /* the + 1 is for the black border in the icon */
- tree_view->priv->press_start_x + 1,
- cell_y + 1);
-
- g_object_unref (row_pix);
- }
-
set_source_row (context, model, path);
out:
@@ -5164,7 +5145,38 @@ static void
gtk_tree_view_drag_begin (GtkWidget *widget,
GdkDragContext *context)
{
- /* do nothing */
+ GtkTreeView *tree_view;
+ GtkTreePath *path = NULL;
+ gint cell_x, cell_y;
+ GdkPixmap *row_pix;
+
+ tree_view = GTK_TREE_VIEW (widget);
+
+ g_return_if_fail (get_info (tree_view) != NULL);
+
+ gtk_tree_view_get_path_at_pos (tree_view,
+ tree_view->priv->press_start_x,
+ tree_view->priv->press_start_y,
+ &path,
+ NULL,
+ &cell_x,
+ &cell_y);
+
+ g_return_if_fail (path != NULL);
+
+ row_pix = gtk_tree_view_create_row_drag_icon (tree_view,
+ path);
+
+ gtk_drag_set_icon_pixmap (context,
+ gdk_drawable_get_colormap (row_pix),
+ row_pix,
+ NULL,
+ /* the + 1 is for the black border in the icon */
+ tree_view->priv->press_start_x + 1,
+ cell_y + 1);
+
+ g_object_unref (row_pix);
+ gtk_tree_path_free (path);
}
static void