mutter/tests/test-timeline.c
Emmanuele Bassi 1a6deea7a7 Use g_list_insert_sorted() instead of our custom function
The clutter_timeout_pool_insert_sorted() function caused an inversion of
the timeout sources in the pool; this led to a wrong behaviour in the
execution of the timeout functions. See bug 471.

This patch drops clutter_timeout_pool_insert_sorted() in favour of the
standard g_list_insert_sorted(), which produces identical behaviours with
and without the pool.

A new test, written by Rob Bradford, has been added to the regression test
suite in order to identify sorting issues with the timeout pools.
2007-08-19 17:06:22 +00:00

56 lines
1.3 KiB
C

#include <clutter/clutter.h>
static void
timeline_1_new_frame_cb (ClutterTimeline *timeline, gint frame_no)
{
g_debug ("1: Doing frame %d.", frame_no);
}
static void
timeline_2_new_frame_cb (ClutterTimeline *timeline, gint frame_no)
{
g_debug ("2: Doing frame %d.", frame_no);
}
static void
timeline_3_new_frame_cb (ClutterTimeline *timeline, gint frame_no)
{
g_debug ("3: Doing frame %d.", frame_no);
}
int
main (int argc, char **argv)
{
ClutterTimeline *timeline_1;
ClutterTimeline *timeline_2;
ClutterTimeline *timeline_3;
clutter_init (&argc, &argv);
timeline_1 = clutter_timeline_new (100, 50);
timeline_2 = clutter_timeline_clone (timeline_1);
timeline_3 = clutter_timeline_clone (timeline_1);
g_signal_connect (timeline_1,
"new-frame", G_CALLBACK (timeline_1_new_frame_cb),
NULL);
g_signal_connect (timeline_2,
"new-frame", G_CALLBACK (timeline_2_new_frame_cb),
NULL);
g_signal_connect (timeline_3,
"new-frame", G_CALLBACK (timeline_3_new_frame_cb),
NULL);
clutter_timeline_start (timeline_1);
clutter_timeline_start (timeline_2);
clutter_timeline_start (timeline_3);
clutter_main ();
g_object_unref (timeline_1);
g_object_unref (timeline_2);
g_object_unref (timeline_3);
return;
}