click-action: Use clutter_actor_contains()
Instead of an internal copy.
This commit is contained in:
parent
f3f3b56742
commit
e00ed20805
@ -101,16 +101,6 @@ click_action_set_pressed (ClutterClickAction *action,
|
|||||||
g_object_notify (G_OBJECT (action), "pressed");
|
g_object_notify (G_OBJECT (action), "pressed");
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
actor_contains_source (ClutterActor *actor,
|
|
||||||
ClutterActor *event_source)
|
|
||||||
{
|
|
||||||
while (event_source != NULL && event_source != actor)
|
|
||||||
event_source = clutter_actor_get_parent (event_source);
|
|
||||||
|
|
||||||
return event_source != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
on_event (ClutterActor *actor,
|
on_event (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
@ -131,7 +121,7 @@ on_event (ClutterActor *actor,
|
|||||||
if (priv->is_held)
|
if (priv->is_held)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (!actor_contains_source (actor, clutter_event_get_source (event)))
|
if (!clutter_actor_contains (actor, clutter_event_get_source (event)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
priv->is_held = TRUE;
|
priv->is_held = TRUE;
|
||||||
@ -153,7 +143,7 @@ on_event (ClutterActor *actor,
|
|||||||
priv->is_held = FALSE;
|
priv->is_held = FALSE;
|
||||||
clutter_ungrab_pointer ();
|
clutter_ungrab_pointer ();
|
||||||
|
|
||||||
if (!actor_contains_source (actor, clutter_event_get_source (event)))
|
if (!clutter_actor_contains (actor, clutter_event_get_source (event)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
click_action_set_pressed (action, FALSE);
|
click_action_set_pressed (action, FALSE);
|
||||||
|
Loading…
Reference in New Issue
Block a user