Shapegames could crash if one tried to move an object while the bonus-object
(e.g. sad flower) was still shown. Fix this by ensuring that the object to move
or drop is the same one that got dragged.

Signed-off-by: Wolfram Sang <wolfram@iswi.org>
---

Note: I'm not very familiar with GUI-coding. It works for me, but there may be
more elegant ways to solve the issue.

 shapegame.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: upstream/shapegame.c
===================================================================
--- upstream.orig/shapegame.c
+++ upstream/shapegame.c
@@ -927,6 +927,7 @@ void target_point_hide()
 static gint item_event_drag(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
 {
     static GnomeCanvasItem *shadow_item=NULL;
+    static GnomeCanvasItem *dragged;
     double item_x, item_y;
     Shape *shape, *found_shape;
 
@@ -1005,11 +1006,15 @@ static gint item_event_drag(GnomeCanvasI
                 gdk_pixbuf_unref(dest);
                 gdk_pixbuf_unref(pixmap);
             }
+	    dragged = shape->item;
             gnome_canvas_item_reparent(shape->item, GNOME_CANVAS_GROUP(shape_list_root_item->parent));
             gnome_canvas_item_raise_to_top(shape->item);
             gc_drag_item_move(event);
             break;
         case GDK_MOTION_NOTIFY:
+	    if (item != dragged)
+		break;
+
             gc_drag_item_move(event);
 
             item_x = event->button.x;
@@ -1034,6 +1039,9 @@ static gint item_event_drag(GnomeCanvasI
             target_point_switch_on(found_shape);
             break;
         case GDK_BUTTON_RELEASE:
+	    if (item != dragged)
+		break;
+
             item_x = event->button.x;
             item_y = event->button.y;
             gnome_canvas_item_w2i(item->parent, &item_x, &item_y);



