From 764c75d2fb5b9899460be33cf36a648a9477492c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 31 Jul 2021 20:42:52 +0200 Subject: [PATCH] screen-cast-session: Add is-active tracking Will be used to determine one can start a new recording or not. Part-of: --- src/backends/meta-screen-cast-session.c | 11 +++++++++++ src/backends/meta-screen-cast-session.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/backends/meta-screen-cast-session.c b/src/backends/meta-screen-cast-session.c index 60fffdea5..d96fb6709 100644 --- a/src/backends/meta-screen-cast-session.c +++ b/src/backends/meta-screen-cast-session.c @@ -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)); diff --git a/src/backends/meta-screen-cast-session.h b/src/backends/meta-screen-cast-session.h index 46bde5eb9..d9c3d0ecc 100644 --- a/src/backends/meta-screen-cast-session.h +++ b/src/backends/meta-screen-cast-session.h @@ -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,