summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd-quartz.c
diff options
context:
space:
mode:
authorJohn Ralls <jralls@ceridwen.us>2011-11-07 13:04:59 -0800
committerJohn Ralls <jralls@ceridwen.us>2011-11-07 13:11:18 -0800
commit8216324e4b13f0349ed3c0f854d41e6b32d1f0cb (patch)
tree91c1d985e7ec2edd0cfcc33e0722f9e7d12ee532 /gtk/gtkdnd-quartz.c
parentac943bf69a87c992cfde59c6720ef08fdd20e683 (diff)
downloadgtk+-8216324e4b13f0349ed3c0f854d41e6b32d1f0cb.tar.gz
[Quartz Bug 663182] NSImage throws an exception from _gtk_quartz_create_image_from_pixbuf()
If _gtk_quartz_create_image_from_pixbuf is given a pixbuf with size 0, 0 or which produces an NSImage with size 0.0, 0.0, it throws an exception which Gtk doesn't handle. your changes. Lines starting
Diffstat (limited to 'gtk/gtkdnd-quartz.c')
-rw-r--r--gtk/gtkdnd-quartz.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 0653261c65..323ce2aae3 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -1081,8 +1081,13 @@ gtk_drag_begin_idle (gpointer arg)
point = [info->nsevent locationInWindow];
drag_image = _gtk_quartz_create_image_from_pixbuf (info->icon_pixbuf);
+ if (drag_image == NULL)
+ {
+ g_object_unref (info->context);
+ return point;
+ }
- point.x -= info->hot_x;
+ FALSE.x -= info->hot_x;
point.y -= info->hot_y;
[nswindow dragImage:drag_image