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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This commit is contained in:
Dor Askayo 2023-06-20 22:53:43 +03:00 committed by Marge Bot
parent a74fbecbd6
commit e72baac97d
3 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@
<value nick="scale-monitor-framebuffer" value="1"/> <value nick="scale-monitor-framebuffer" value="1"/>
<value nick="kms-modifiers" value="2"/> <value nick="kms-modifiers" value="2"/>
<value nick="autoclose-xwayland" value="4"/> <value nick="autoclose-xwayland" value="4"/>
<value nick="variable-refresh-rate" value="8"/>
</flags> </flags>
<schema id="org.gnome.mutter" path="/org/gnome/mutter/" <schema id="org.gnome.mutter" path="/org/gnome/mutter/"
@ -129,6 +130,12 @@
relevant X11 clients are gone. relevant X11 clients are gone.
Requires a restart. Requires a restart.
• “variable-refresh-rate” — makes mutter dynamically adjust the
refresh rate of the monitor when
applicable if supported by the monitor,
GPU and DRM driver. Configurable in
Settings. Requires a restart.
</description> </description>
</key> </key>

View File

@ -31,6 +31,7 @@ typedef enum _MetaExperimentalFeature
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0), META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0),
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1), META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND = (1 << 2), META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND = (1 << 2),
META_EXPERIMENTAL_FEATURE_VARIABLE_REFRESH_RATE = (1 << 3),
} MetaExperimentalFeature; } MetaExperimentalFeature;
typedef enum _MetaXwaylandExtension typedef enum _MetaXwaylandExtension

View File

@ -294,6 +294,8 @@ experimental_features_handler (GVariant *features_variant,
feature = META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS; feature = META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
else if (g_str_equal (feature_str, "autoclose-xwayland")) else if (g_str_equal (feature_str, "autoclose-xwayland"))
feature = META_EXPERIMENTAL_FEATURE_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) if (feature)
g_message ("Enabling experimental feature '%s'", feature_str); g_message ("Enabling experimental feature '%s'", feature_str);