drag-action: Disable picking during drag
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.
This commit is contained in:
parent
d89270d7c1
commit
62c08b4a09
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user