Use _once variant of g_[timeout_idle]

Nice helpers that were added in GLib 2.72, so safe to make use of as we
depend on 2.81.1 already.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4115>
This commit is contained in:
Bilal Elmoussaoui
2024-11-02 23:23:21 +01:00
committed by Marge Bot
parent ae4cdcf205
commit a5be92e03d
23 changed files with 89 additions and 146 deletions

View File

@ -759,7 +759,7 @@ meta_screen_cast_stream_src_pending_follow_up_frame (MetaScreenCastStreamSrc *sr
return priv->follow_up_frame_source_id != 0;
}
static gboolean
static void
follow_up_frame_cb (gpointer user_data)
{
MetaScreenCastStreamSrc *src = user_data;
@ -768,8 +768,6 @@ follow_up_frame_cb (gpointer user_data)
priv->follow_up_frame_source_id = 0;
meta_screen_cast_stream_src_record_follow_up (src);
return G_SOURCE_REMOVE;
}
static void
@ -782,9 +780,9 @@ maybe_schedule_follow_up_frame (MetaScreenCastStreamSrc *src,
if (priv->follow_up_frame_source_id)
return;
priv->follow_up_frame_source_id = g_timeout_add (us2ms (timeout_us),
follow_up_frame_cb,
src);
priv->follow_up_frame_source_id = g_timeout_add_once (us2ms (timeout_us),
follow_up_frame_cb,
src);
}
static void