diff options
author | Richard Hult <richard@imendio.com> | 2006-07-17 21:21:25 +0000 |
---|---|---|
committer | Richard Hult <rhult@src.gnome.org> | 2006-07-17 21:21:25 +0000 |
commit | 51edd19e1691375bd41a661dacd5e1fecb421563 (patch) | |
tree | 6a645a069009f78e055fe4737769c4be246fd447 /gtk/gtkdnd-quartz.c | |
parent | 6d8662d3d92f9ceb002441fffc4a4166fc6648f5 (diff) | |
download | gtk+-51edd19e1691375bd41a661dacd5e1fecb421563.tar.gz |
Set an empty NSImage if there is none, covers the cases where applications
2006-07-17 Richard Hult <richard@imendio.com>
* gtk/gtkdnd-quartz.c: (gtk_drag_begin_internal): Set an empty
NSImage if there is none, covers the cases where applications try
to set a pixmap which is not supported by the quartz backend.
Diffstat (limited to 'gtk/gtkdnd-quartz.c')
-rw-r--r-- | gtk/gtkdnd-quartz.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index c868674603..ec44ef64e1 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -1040,11 +1040,28 @@ gtk_drag_begin_internal (GtkWidget *widget, switch (site->icon_type) { case GTK_IMAGE_PIXMAP: - gtk_drag_set_icon_pixmap (context, - site->colormap, - site->icon_data.pixmap.pixmap, - site->icon_mask, - -2, -2); + /* This is not supported, so just set a small transparent pixbuf + * since we need to have something. + */ + if (0) + gtk_drag_set_icon_pixmap (context, + site->colormap, + site->icon_data.pixmap.pixmap, + site->icon_mask, + -2, -2); + else + { + GdkPixbuf *pixbuf; + + pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 1, 1); + gdk_pixbuf_fill (pixbuf, 0xffffff); + + gtk_drag_set_icon_pixbuf (context, + pixbuf, + 0, 0); + + g_object_unref (pixbuf); + } break; case GTK_IMAGE_PIXBUF: gtk_drag_set_icon_pixbuf (context, |