From 19539bd93c521002222a895dca3abf3f3c46a1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 7 Jun 2018 10:21:06 +0200 Subject: [PATCH] Make screen cast and remote desktop non-experimental It's time to make this feature more accessible by not requiring editing an array in gsettings. --- data/org.gnome.mutter.gschema.xml.in | 4 --- src/backends/meta-backend.c | 51 ++-------------------------- src/backends/meta-settings-private.h | 4 +-- src/backends/meta-settings.c | 4 --- 4 files changed, 3 insertions(+), 60 deletions(-) diff --git a/data/org.gnome.mutter.gschema.xml.in b/data/org.gnome.mutter.gschema.xml.in index d926312c89..6cbd9c1b50 100644 --- a/data/org.gnome.mutter.gschema.xml.in +++ b/data/org.gnome.mutter.gschema.xml.in @@ -120,10 +120,6 @@ framebuffers instead of window content, to manage HiDPI monitors. Does not require a restart. - • “remote-desktop” — enables remote desktop support. To support - remote desktop with screen sharing, - “screen-cast” must also be enabled. - • “screen-cast” — enables screen cast support. diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 4ebceb4ea6..b523a91d4d 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -402,28 +402,6 @@ meta_backend_create_input_settings (MetaBackend *backend) return META_BACKEND_GET_CLASS (backend)->create_input_settings (backend); } -#ifdef HAVE_REMOTE_DESKTOP -static gboolean -is_screen_cast_enabled (MetaBackend *backend) -{ - MetaSettings *settings = meta_backend_get_settings (backend); - - return meta_settings_is_experimental_feature_enabled ( - settings, - META_EXPERIMENTAL_FEATURE_SCREEN_CAST); -} - -static gboolean -is_remote_desktop_enabled (MetaBackend *backend) -{ - MetaSettings *settings = meta_backend_get_settings (backend); - - return meta_settings_is_experimental_feature_enabled ( - settings, - META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP); -} -#endif /* HAVE_REMOTE_DESKTOP */ - static void meta_backend_real_post_init (MetaBackend *backend) { @@ -457,10 +435,8 @@ meta_backend_real_post_init (MetaBackend *backend) #ifdef HAVE_REMOTE_DESKTOP priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL); - if (is_screen_cast_enabled (backend)) - priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher); - if (is_remote_desktop_enabled (backend)) - priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher); + priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher); + priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher); #endif /* HAVE_REMOTE_DESKTOP */ if (!meta_monitor_manager_is_headless (priv->monitor_manager)) @@ -552,26 +528,6 @@ meta_backend_class_init (MetaBackendClass *klass) stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0; } -static void -experimental_features_changed (MetaSettings *settings, - MetaExperimentalFeature old_experimental_features, - MetaBackend *backend) -{ -#ifdef HAVE_REMOTE_DESKTOP - MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); - - if (is_screen_cast_enabled (backend) && !priv->screen_cast) - priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher); - else if (!is_screen_cast_enabled (backend)) - g_clear_object (&priv->screen_cast); - - if (is_remote_desktop_enabled (backend) && !priv->remote_desktop) - priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher); - else if (!is_remote_desktop_enabled (backend)) - g_clear_object (&priv->remote_desktop); -#endif /* HAVE_REMOTE_DESKTOP */ -} - static MetaMonitorManager * meta_backend_create_monitor_manager (MetaBackend *backend, GError **error) @@ -599,9 +555,6 @@ meta_backend_initable_init (GInitable *initable, MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); priv->settings = meta_settings_new (backend); - g_signal_connect (priv->settings, "experimental-features-changed", - G_CALLBACK (experimental_features_changed), - backend); priv->egl = g_object_new (META_TYPE_EGL, NULL); diff --git a/src/backends/meta-settings-private.h b/src/backends/meta-settings-private.h index a8cb6a5499..90bfb439f0 100644 --- a/src/backends/meta-settings-private.h +++ b/src/backends/meta-settings-private.h @@ -31,9 +31,7 @@ typedef enum _MetaExperimentalFeature { META_EXPERIMENTAL_FEATURE_NONE = 0, META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0), - META_EXPERIMENTAL_FEATURE_SCREEN_CAST = (1 << 1), - META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP = (1 << 2), - META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 3), + META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1), } MetaExperimentalFeature; #define META_TYPE_SETTINGS (meta_settings_get_type ()) diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c index 6f47c5f58c..a73850ed67 100644 --- a/src/backends/meta-settings.c +++ b/src/backends/meta-settings.c @@ -263,10 +263,6 @@ experimental_features_handler (GVariant *features_variant, /* So far no experimental features defined. */ if (g_str_equal (feature, "scale-monitor-framebuffer")) features |= META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER; - else if (g_str_equal (feature, "screen-cast")) - features |= META_EXPERIMENTAL_FEATURE_SCREEN_CAST; - else if (g_str_equal (feature, "remote-desktop")) - features |= META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP; else if (g_str_equal (feature, "kms-modifiers")) features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS; else -- 2.17.1