summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-03-30 18:22:39 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-03-30 18:22:39 +0000
commitbbec8800a40e88a5f13b0d2ba17dfe8d39f61233 (patch)
tree178e86d1de02e73f1d922b78f222877573f5f6cc /gtk/gtkdnd.c
parentcfd72f5cd62e23ca4df0d4d339d84ff928182acd (diff)
downloadgtk+-bbec8800a40e88a5f13b0d2ba17dfe8d39f61233.tar.gz
Make sure to get an icon window when constructing the fallback_icon. This
2006-03-30 Matthias Clasen <mclasen@redhat.com> * gtk/gtkdnd.c (gtk_drag_get_icon): Make sure to get an icon window when constructing the fallback_icon. This fixes a crash when dragging icons between screens in nautilus. (#325751, Hylke van der Schaaf)
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r--gtk/gtkdnd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index ca55e2d859..46cf9ae0cf 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -288,6 +288,13 @@ static gboolean gtk_drag_button_release_cb (GtkWidget *widget,
gpointer data);
static gboolean gtk_drag_abort_timeout (gpointer data);
+static void set_icon_stock_pixbuf (GdkDragContext *context,
+ const gchar *stock_id,
+ GdkPixbuf *pixbuf,
+ gint hot_x,
+ gint hot_y,
+ gboolean force_window);
+
/************************
* Cursor and Icon data *
************************/
@@ -2764,7 +2771,16 @@ gtk_drag_get_icon (GtkDragSourceInfo *info,
save_destroy_icon = info->destroy_icon;
info->icon_window = NULL;
- gtk_drag_set_icon_default (info->context);
+ if (!default_icon_pixmap)
+ set_icon_stock_pixbuf (info->context,
+ GTK_STOCK_DND, NULL, -2, -2, TRUE);
+ else
+ gtk_drag_set_icon_pixmap (info->context,
+ default_icon_colormap,
+ default_icon_pixmap,
+ default_icon_mask,
+ default_icon_hot_x,
+ default_icon_hot_y);
info->fallback_icon = info->icon_window;
info->icon_window = save_icon_window;
@@ -3145,7 +3161,7 @@ gtk_drag_set_icon_name (GdkDragContext *context,
* icon.
**/
void
-gtk_drag_set_icon_default (GdkDragContext *context)
+gtk_drag_set_icon_default (GdkDragContext *context)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
g_return_if_fail (context->is_source);