From f0ded315e43758f1fc1a16a132c63c873d5b5710 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 3 Jun 2010 23:34:09 -0400 Subject: [PATCH] g_source_set_name on custom sources (if available) Call g_source_set_name, if the versio of GLib is new enough. This aids debugging, using e.g. SystemTap. See https://bugzilla.gnome.org/show_bug.cgi?id=620511 for more information http://bugzilla.openedhand.com/show_bug.cgi?id=2151 Signed-off-by: Emmanuele Bassi --- clutter/clutter-frame-source.c | 4 ++++ clutter/clutter-master-clock.c | 3 +++ clutter/clutter-timeout-pool.c | 4 ++++ clutter/x11/clutter-event-x11.c | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/clutter/clutter-frame-source.c b/clutter/clutter-frame-source.c index c3cb04262..88aa5e801 100644 --- a/clutter/clutter-frame-source.c +++ b/clutter/clutter-frame-source.c @@ -101,6 +101,10 @@ clutter_frame_source_add_full (gint priority, if (priority != G_PRIORITY_DEFAULT) g_source_set_priority (source, priority); +#if GLIB_CHECK_VERSION (2, 25, 8) + g_source_set_name (source, "Clutter frame timeout"); +#endif + g_source_set_callback (source, func, data, notify); ret = g_source_attach (source, NULL); diff --git a/clutter/clutter-master-clock.c b/clutter/clutter-master-clock.c index 8b4a42f95..679db113a 100644 --- a/clutter/clutter-master-clock.c +++ b/clutter/clutter-master-clock.c @@ -260,6 +260,9 @@ clutter_clock_source_new (ClutterMasterClock *master_clock) GSource *source = g_source_new (&clock_funcs, sizeof (ClutterClockSource)); ClutterClockSource *clock_source = (ClutterClockSource *) source; +#if GLIB_CHECK_VERSION (2, 25, 8) + g_source_set_name (source, "Clutter master clock"); +#endif clock_source->master_clock = master_clock; return source; diff --git a/clutter/clutter-timeout-pool.c b/clutter/clutter-timeout-pool.c index e945e2653..5e25d86f9 100644 --- a/clutter/clutter-timeout-pool.c +++ b/clutter/clutter-timeout-pool.c @@ -377,6 +377,10 @@ clutter_timeout_pool_new (gint priority) if (!source) return NULL; +#if GLIB_CHECK_VERSION (2, 25, 8) + g_source_set_name (source, "Clutter timeout pool"); +#endif + if (priority != G_PRIORITY_DEFAULT) g_source_set_priority (source, priority); diff --git a/clutter/x11/clutter-event-x11.c b/clutter/x11/clutter-event-x11.c index 20a77fd06..8089c21b7 100644 --- a/clutter/x11/clutter-event-x11.c +++ b/clutter/x11/clutter-event-x11.c @@ -105,6 +105,10 @@ clutter_event_source_new (ClutterBackend *backend) GSource *source = g_source_new (&event_funcs, sizeof (ClutterEventSource)); ClutterEventSource *event_source = (ClutterEventSource *) source; +#if GLIB_CHECK_VERSION (2, 25, 8) + g_source_set_name (source, "Clutter X11 Event"); +#endif + event_source->backend = backend; return source;