From e72baac97d2ddc520da255c006fdb6fb4941cc84 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Tue, 20 Jun 2023 22:53:43 +0300 Subject: [PATCH] settings: Add experimental feature for variable refresh rate Require the "variable-refresh-rate" keyword under the "experimental-features" gsetting to enable the feature for now. It would no longer be required once the experience with variable refresh rate is good enough for general use and handles all common use cases well. Part-of: --- data/org.gnome.mutter.gschema.xml.in | 7 +++++++ src/backends/meta-settings-private.h | 1 + src/backends/meta-settings.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/data/org.gnome.mutter.gschema.xml.in b/data/org.gnome.mutter.gschema.xml.in index fa8cf95dd..92c97b12e 100644 --- a/data/org.gnome.mutter.gschema.xml.in +++ b/data/org.gnome.mutter.gschema.xml.in @@ -4,6 +4,7 @@ + diff --git a/src/backends/meta-settings-private.h b/src/backends/meta-settings-private.h index ca14ce67c..afbba054a 100644 --- a/src/backends/meta-settings-private.h +++ b/src/backends/meta-settings-private.h @@ -31,6 +31,7 @@ typedef enum _MetaExperimentalFeature META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0), META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1), META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND = (1 << 2), + META_EXPERIMENTAL_FEATURE_VARIABLE_REFRESH_RATE = (1 << 3), } MetaExperimentalFeature; typedef enum _MetaXwaylandExtension diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c index 486ac5abb..3703b23b0 100644 --- a/src/backends/meta-settings.c +++ b/src/backends/meta-settings.c @@ -294,6 +294,8 @@ experimental_features_handler (GVariant *features_variant, feature = META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS; else if (g_str_equal (feature_str, "autoclose-xwayland")) feature = META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND; + else if (g_str_equal (feature_str, "variable-refresh-rate")) + feature = META_EXPERIMENTAL_FEATURE_VARIABLE_REFRESH_RATE; if (feature) g_message ("Enabling experimental feature '%s'", feature_str);