[gcompris/gcomprixogoo] Reimplemented the check for gc_drag_target != target like we had before
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] Reimplemented the check for gc_drag_target != target like we had before
- Date: Mon, 23 Nov 2009 20:45:14 +0000 (UTC)
commit f2e929db6beeee52487c4e435c41c8a645d82e46
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Mon Nov 23 21:37:36 2009 +0100
Reimplemented the check for gc_drag_target != target like we had before
my last commit on drag.c. I am not sure in which case it is needed but
lets be concervative on the drag and drop.
src/gcompris/drag.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gcompris/drag.c b/src/gcompris/drag.c
index b8bd689..5d27605 100644
--- a/src/gcompris/drag.c
+++ b/src/gcompris/drag.c
@@ -29,6 +29,7 @@ static int gc_drag_status;
static gc_drag_mode_type gc_drag_mode;
static GooCanvasItem *gc_drag_item;
+static GooCanvasItem *gc_drag_target;
static double gc_drag_offset_x, gc_drag_offset_y;
GooCanvasItem*
@@ -112,6 +113,7 @@ gc_drag_event (GooCanvasItem *item,
if(gc_drag_status == 0 && event->button == 1)
{
gc_drag_item = item;
+ gc_drag_target = target;
if(gc_drag_mode == GC_DRAG_MODE_GRAB)
gc_drag_status = 2;
else
@@ -130,6 +132,7 @@ gc_drag_event (GooCanvasItem *item,
data);
gc_drag_status = 0;
gc_drag_item = NULL;
+ gc_drag_target = NULL;
gc_drag_user_data = NULL;
}
else if (gc_drag_status == 1 && gc_drag_mode & GC_DRAG_MODE_2CLICKS)
@@ -147,6 +150,9 @@ gc_drag_event_root(GooCanvasItem * item,
GdkEventMotion *event,
gpointer data)
{
+ if(gc_drag_target != target)
+ return FALSE;
+
switch(event->type)
{
case GDK_MOTION_NOTIFY:
@@ -178,6 +184,7 @@ gc_drag_start(GooCanvasItem *root_item,
gc_drag_user_data = NULL;
gc_drag_status = 0;
gc_drag_item = NULL;
+ gc_drag_target = NULL;
gc_drag_offset_x = gc_drag_offset_y = 0;
if (mode == GC_DRAG_MODE_DEFAULT)
gc_drag_mode = gc_prop_get()->drag_mode;
@@ -203,6 +210,7 @@ gc_drag_stop(GooCanvasItem *root_item)
gc_drag_user_data = NULL;
gc_drag_status = -1;
gc_drag_item = NULL;
+ gc_drag_target = NULL;
gc_drag_mode = 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]