From 62c08b4a0995467f54d8135e7c579e2f81debb20 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 22 Jun 2010 16:12:53 +0100 Subject: [PATCH] drag-action: Disable picking during drag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While dragging we don't need to perform picking to determine the actor underneath the pointer, for two reasons: • we use a capture on the stage to determine the motion delta. • we know the actor underneath the pointer because that's the actor we are dragging around. This change should make dragging actors in complex scenes a bit faster. --- clutter/clutter-drag-action.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-drag-action.c b/clutter/clutter-drag-action.c index 4ca104fed..7e4d7a3bb 100644 --- a/clutter/clutter-drag-action.c +++ b/clutter/clutter-drag-action.c @@ -89,8 +89,9 @@ struct _ClutterDragActionPrivate gfloat transformed_press_x; gfloat transformed_press_y; - guint emit_delayed_press : 1; - guint in_drag : 1; + guint emit_delayed_press : 1; + guint in_drag : 1; + guint motion_events_enabled : 1; }; enum @@ -127,6 +128,9 @@ emit_drag_begin (ClutterDragAction *action, { ClutterDragActionPrivate *priv = action->priv; + priv->motion_events_enabled = clutter_get_motion_events_enabled (); + clutter_set_motion_events_enabled (FALSE); + g_signal_emit (action, drag_signals[DRAG_BEGIN], 0, actor, priv->press_x, priv->press_y, @@ -219,6 +223,8 @@ emit_drag_end (ClutterDragAction *action, priv->capture_id = 0; } + clutter_set_motion_events_enabled (priv->motion_events_enabled); + priv->in_drag = FALSE; }