[mutter] screen-cast-session: Add is-active tracking



commit 764c75d2fb5b9899460be33cf36a648a9477492c
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sat Jul 31 20:42:52 2021 +0200

    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>

 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 60fffdea5e..d96fb6709f 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 46bde5eb9b..d9c3d0ecca 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]