tests: Avoid getting the stage through ClutterEvents

Obtain the stage through other means, as this information will
eventually move away from events.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
Carlos Garnacho 2023-08-02 18:56:03 +02:00
parent 36fda95217
commit af9d406610
2 changed files with 6 additions and 3 deletions

View File

@ -120,7 +120,10 @@ test_action_handle_event (ClutterAction *action,
if (action_claim_sequence)
{
clutter_stage_notify_action_implicit_grab (clutter_event_get_stage (event),
ClutterActor *actor;
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
clutter_stage_notify_action_implicit_grab (CLUTTER_STAGE (clutter_actor_get_stage (actor)),
clutter_event_get_device (event),
clutter_event_get_event_sequence (event));
}

View File

@ -94,7 +94,7 @@ debug_event_cb (ClutterActor *actor,
return FALSE;
}
target = clutter_stage_get_device_actor (clutter_event_get_stage (event),
target = clutter_stage_get_device_actor (CLUTTER_STAGE (clutter_actor_get_stage (actor)),
clutter_event_get_device (event),
clutter_event_get_event_sequence (event));
if (target == actor)
@ -149,7 +149,7 @@ toggle_grab_pointer_cb (ClutterActor *actor,
ClutterActor *target;
/* we only deal with the event if the source is ourself */
target = clutter_stage_get_device_actor (clutter_event_get_stage (event),
target = clutter_stage_get_device_actor (CLUTTER_STAGE (clutter_actor_get_stage (actor)),
clutter_event_get_device (event),
clutter_event_get_event_sequence (event));