screen-cast-session: Add is-active tracking

Will be used to determine one can start a new recording or not.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2131>
This commit is contained in:
Jonas Ådahl 2021-07-31 20:42:52 +02:00 committed by Marge Bot
parent 3c1f50a85e
commit 764c75d2fb
2 changed files with 13 additions and 0 deletions

View File

@ -51,6 +51,7 @@ struct _MetaScreenCastSession
MetaScreenCastSessionHandle *handle;
gboolean is_active;
gboolean disable_animations;
};
@ -117,14 +118,24 @@ meta_screen_cast_session_start (MetaScreenCastSession *session,
init_remote_access_handle (session);
session->is_active = TRUE;
return TRUE;
}
gboolean
meta_screen_cast_session_is_active (MetaScreenCastSession *session)
{
return session->is_active;
}
void
meta_screen_cast_session_close (MetaScreenCastSession *session)
{
MetaDBusScreenCastSession *skeleton = META_DBUS_SCREEN_CAST_SESSION (session);
session->is_active = FALSE;
g_list_free_full (session->streams, g_object_unref);
meta_dbus_session_notify_closed (META_DBUS_SESSION (session));

View File

@ -59,6 +59,8 @@ MetaScreenCastSession * meta_screen_cast_session_new (MetaScreenCast
gboolean meta_screen_cast_session_start (MetaScreenCastSession *session,
GError **error);
gboolean meta_screen_cast_session_is_active (MetaScreenCastSession *session);
void meta_screen_cast_session_close (MetaScreenCastSession *session);
MetaScreenCastStream * meta_screen_cast_session_get_stream (MetaScreenCastSession *session,