mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
tests/clutter/event-delivery: Queue update before waiting
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2727>
This commit is contained in:
parent
2d7e5e7671
commit
bd72b671fc
@ -21,9 +21,11 @@ on_event_return_stop (ClutterActor *actor,
|
||||
}
|
||||
|
||||
static void
|
||||
wait_stage_updated (gboolean *was_updated)
|
||||
wait_stage_updated (ClutterStage *stage,
|
||||
gboolean *was_updated)
|
||||
{
|
||||
*was_updated = FALSE;
|
||||
clutter_stage_schedule_update (stage);
|
||||
while (!*was_updated)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
}
|
||||
@ -53,11 +55,11 @@ event_delivery_consecutive_touch_begin_end (void)
|
||||
clutter_virtual_input_device_notify_touch_up (virtual_pointer, now_us, 0);
|
||||
clutter_virtual_input_device_notify_touch_down (virtual_pointer, now_us, 0, 5, 5);
|
||||
g_assert_true (!was_updated);
|
||||
wait_stage_updated (&was_updated);
|
||||
wait_stage_updated (CLUTTER_STAGE (stage), &was_updated);
|
||||
g_assert_cmpint (n_captured_touch_events, ==, 3);
|
||||
|
||||
clutter_virtual_input_device_notify_touch_up (virtual_pointer, now_us, 0);
|
||||
wait_stage_updated (&was_updated);
|
||||
wait_stage_updated (CLUTTER_STAGE (stage), &was_updated);
|
||||
g_assert_cmpint (n_captured_touch_events, ==, 4);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (stage, on_event_return_stop, &n_captured_touch_events);
|
||||
|
Loading…
Reference in New Issue
Block a user