From adc6537917627fe5426fc58492a6e740023471ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 23 Feb 2021 08:59:43 +0100 Subject: [PATCH] remote-desktop: Add backend getter Part-of: --- src/backends/meta-backend.c | 3 ++- src/backends/meta-remote-desktop.c | 11 ++++++++++- src/backends/meta-remote-desktop.h | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index def62c49a..0788cf102 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -619,7 +619,8 @@ meta_backend_real_post_init (MetaBackend *backend) priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL); priv->screen_cast = meta_screen_cast_new (backend, priv->dbus_session_watcher); - priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher); + priv->remote_desktop = meta_remote_desktop_new (backend, + priv->dbus_session_watcher); priv->remote_access_controller = meta_remote_access_controller_new (priv->remote_desktop, priv->screen_cast); #endif /* HAVE_REMOTE_DESKTOP */ diff --git a/src/backends/meta-remote-desktop.c b/src/backends/meta-remote-desktop.c index 1b73f4a91..0c9d4f0ad 100644 --- a/src/backends/meta-remote-desktop.c +++ b/src/backends/meta-remote-desktop.c @@ -54,6 +54,7 @@ struct _MetaRemoteDesktop { MetaDBusRemoteDesktopSkeleton parent; + MetaBackend *backend; int dbus_name_id; int inhibit_count; @@ -100,6 +101,12 @@ meta_remote_desktop_uninhibit (MetaRemoteDesktop *remote_desktop) remote_desktop->inhibit_count--; } +MetaBackend * +meta_remote_desktop_get_backend (MetaRemoteDesktop *remote_desktop) +{ + return remote_desktop->backend; +} + GDBusConnection * meta_remote_desktop_get_connection (MetaRemoteDesktop *remote_desktop) { @@ -260,11 +267,13 @@ meta_remote_desktop_finalize (GObject *object) } MetaRemoteDesktop * -meta_remote_desktop_new (MetaDbusSessionWatcher *session_watcher) +meta_remote_desktop_new (MetaBackend *backend, + MetaDbusSessionWatcher *session_watcher) { MetaRemoteDesktop *remote_desktop; remote_desktop = g_object_new (META_TYPE_REMOTE_DESKTOP, NULL); + remote_desktop->backend = backend; remote_desktop->session_watcher = session_watcher; return remote_desktop; diff --git a/src/backends/meta-remote-desktop.h b/src/backends/meta-remote-desktop.h index 210a84a04..3a7f38563 100644 --- a/src/backends/meta-remote-desktop.h +++ b/src/backends/meta-remote-desktop.h @@ -25,6 +25,7 @@ #include +#include "backends/meta-backend-types.h" #include "backends/meta-dbus-session-watcher.h" #include "meta-dbus-remote-desktop.h" @@ -40,11 +41,14 @@ void meta_remote_desktop_inhibit (MetaRemoteDesktop *remote_desktop); void meta_remote_desktop_uninhibit (MetaRemoteDesktop *remote_desktop); +MetaBackend * meta_remote_desktop_get_backend (MetaRemoteDesktop *remote_desktop); + MetaRemoteDesktopSession * meta_remote_desktop_get_session (MetaRemoteDesktop *remote_desktop, const char *session_id); GDBusConnection * meta_remote_desktop_get_connection (MetaRemoteDesktop *remote_desktop); -MetaRemoteDesktop * meta_remote_desktop_new (MetaDbusSessionWatcher *session_watcher); +MetaRemoteDesktop * meta_remote_desktop_new (MetaBackend *backend, + MetaDbusSessionWatcher *session_watcher); #endif /* META_REMOTE_DESKTOP_H */