settings: Allow overriding experimental settings with an env var
This makes it simpler to experiment with experimental settings without having to make changes to any gsettings fields one might not want to change. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
This commit is contained in:
parent
6e8c7c5f84
commit
36eee131c2
1 changed files with 25 additions and 0 deletions
|
@ -43,6 +43,14 @@ enum
|
|||
N_SIGNALS
|
||||
};
|
||||
|
||||
static GDebugKey experimental_feature_keys[] = {
|
||||
{ "scale-monitor-framebuffer", META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER },
|
||||
{ "kms-modifiers", META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS },
|
||||
{ "autoclose-xwayland", META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND },
|
||||
{ "variable-refresh-rate", META_EXPERIMENTAL_FEATURE_VARIABLE_REFRESH_RATE },
|
||||
{ "xwayland-native-scaling", META_EXPERIMENTAL_FEATURE_XWAYLAND_NATIVE_SCALING },
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS];
|
||||
|
||||
struct _MetaSettings
|
||||
|
@ -544,6 +552,8 @@ meta_settings_dispose (GObject *object)
|
|||
static void
|
||||
meta_settings_init (MetaSettings *settings)
|
||||
{
|
||||
const char *experimental_features_env;
|
||||
|
||||
settings->interface_settings = g_settings_new ("org.gnome.desktop.interface");
|
||||
g_signal_connect (settings->interface_settings, "changed",
|
||||
G_CALLBACK (interface_settings_changed),
|
||||
|
@ -567,6 +577,21 @@ meta_settings_init (MetaSettings *settings)
|
|||
g_signal_connect (settings, "ui-scaling-factor-changed",
|
||||
G_CALLBACK (meta_settings_update_font_dpi), NULL);
|
||||
|
||||
experimental_features_env = getenv ("MUTTER_DEBUG_EXPERIMENTAL_FEATURES");
|
||||
if (experimental_features_env)
|
||||
{
|
||||
MetaExperimentalFeature experimental_features;
|
||||
|
||||
experimental_features =
|
||||
g_parse_debug_string (experimental_features_env,
|
||||
experimental_feature_keys,
|
||||
G_N_ELEMENTS (experimental_feature_keys));
|
||||
|
||||
meta_settings_override_experimental_features (settings);
|
||||
meta_settings_enable_experimental_feature (settings,
|
||||
experimental_features);
|
||||
}
|
||||
|
||||
update_global_scaling_factor (settings);
|
||||
update_experimental_features (settings);
|
||||
update_xwayland_grab_access_rules (settings);
|
||||
|
|
Loading…
Add table
Reference in a new issue