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.
This commit is contained in:
Jonas Ådahl 2018-06-07 10:21:06 +02:00 committed by Ray Strode
parent 22e507e315
commit b65f3c3985
4 changed files with 3 additions and 60 deletions

View File

@ -120,10 +120,6 @@
framebuffers instead of window content, framebuffers instead of window content,
to manage HiDPI monitors. Does not to manage HiDPI monitors. Does not
require a restart. 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.
</description> </description>
</key> </key>

View File

@ -418,28 +418,6 @@ meta_backend_create_input_settings (MetaBackend *backend)
return META_BACKEND_GET_CLASS (backend)->create_input_settings (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 static void
meta_backend_real_post_init (MetaBackend *backend) meta_backend_real_post_init (MetaBackend *backend)
{ {
@ -473,9 +451,7 @@ meta_backend_real_post_init (MetaBackend *backend)
#ifdef HAVE_REMOTE_DESKTOP #ifdef HAVE_REMOTE_DESKTOP
priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL); 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); 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->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
#endif /* HAVE_REMOTE_DESKTOP */ #endif /* HAVE_REMOTE_DESKTOP */
@ -568,26 +544,6 @@ meta_backend_class_init (MetaBackendClass *klass)
stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0; 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 * static MetaMonitorManager *
meta_backend_create_monitor_manager (MetaBackend *backend, meta_backend_create_monitor_manager (MetaBackend *backend,
GError **error) GError **error)
@ -670,9 +626,6 @@ meta_backend_initable_init (GInitable *initable,
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
priv->settings = meta_settings_new (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); priv->egl = g_object_new (META_TYPE_EGL, NULL);

View File

@ -31,9 +31,7 @@ typedef enum _MetaExperimentalFeature
{ {
META_EXPERIMENTAL_FEATURE_NONE = 0, META_EXPERIMENTAL_FEATURE_NONE = 0,
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0), META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0),
META_EXPERIMENTAL_FEATURE_SCREEN_CAST = (1 << 1), META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP = (1 << 2),
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 3),
} MetaExperimentalFeature; } MetaExperimentalFeature;
#define META_TYPE_SETTINGS (meta_settings_get_type ()) #define META_TYPE_SETTINGS (meta_settings_get_type ())

View File

@ -263,10 +263,6 @@ experimental_features_handler (GVariant *features_variant,
/* So far no experimental features defined. */ /* So far no experimental features defined. */
if (g_str_equal (feature, "scale-monitor-framebuffer")) if (g_str_equal (feature, "scale-monitor-framebuffer"))
features |= META_EXPERIMENTAL_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")) else if (g_str_equal (feature, "kms-modifiers"))
features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS; features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
else else