[gnome-remote-desktop] session: Add method to notify subclasses when session proxy is ready



commit 16e51d7ac0fd14001d45cb17dded75691b51f518
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Tue Oct 27 18:49:05 2020 +0100

    session: Add method to notify subclasses when session proxy is ready
    
    Add a member function for grd-session which will be called when the
    remote desktop session proxy is acquired.
    This allows subclass implementations to call necessary initialization
    methods that depend on the remote desktop session proxy to be there.

 src/grd-session.c | 4 ++++
 src/grd-session.h | 1 +
 2 files changed, 5 insertions(+)
---
diff --git a/src/grd-session.c b/src/grd-session.c
index 2c54c30..d945176 100644
--- a/src/grd-session.c
+++ b/src/grd-session.c
@@ -685,6 +685,7 @@ on_remote_desktop_session_proxy_acquired (GObject      *object,
 {
   GrdSession *session = user_data;
   GrdSessionPrivate *priv = grd_session_get_instance_private (session);
+  GrdSessionClass *klass = GRD_SESSION_GET_CLASS (session);
   GrdDBusRemoteDesktopSession *session_proxy;
   GError *error = NULL;
   const char *remote_desktop_session_id;
@@ -735,6 +736,9 @@ on_remote_desktop_session_proxy_acquired (GObject      *object,
                                             priv->cancellable,
                                             on_screen_cast_session_created,
                                             session);
+
+  if (klass->remote_desktop_session_ready)
+    klass->remote_desktop_session_ready (session);
 }
 
 static void
diff --git a/src/grd-session.h b/src/grd-session.h
index 937c068..7ecbaaf 100644
--- a/src/grd-session.h
+++ b/src/grd-session.h
@@ -63,6 +63,7 @@ struct _GrdSessionClass
 {
   GObjectClass parent_class;
 
+  void (*remote_desktop_session_ready) (GrdSession *session);
   void (*stream_ready) (GrdSession *session,
                         GrdStream  *stream);
   void (*stop) (GrdSession *session);


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