monitor-manger: Expose the minimum refresh rate of monitors

This exposes the minimum refresh rate of monitors through D-Bus.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
This commit is contained in:
Dor Askayo 2024-02-11 02:27:30 +02:00 committed by Marge Bot
parent a53c02bba5
commit 8df0beae08
2 changed files with 12 additions and 0 deletions

View File

@ -359,6 +359,9 @@
it's enabled and second value whether it's
hardware locked (and so can't be changed
via gsettings)
- "min-refresh-rate" (i): minimum refresh rate of monitor when
Variable Refresh Rate is active (absence
of this means unknown)
Possible mode flags:
1 : preferred mode

View File

@ -2073,6 +2073,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
MetaMonitorMode *current_mode;
MetaMonitorMode *preferred_mode;
MetaPrivacyScreenState privacy_screen_state;
int min_refresh_rate;
GVariantBuilder modes_builder;
GVariantBuilder monitor_properties_builder;
GList *k;
@ -2190,6 +2191,14 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
"privacy-screen-state", state);
}
if (meta_monitor_get_min_refresh_rate (monitor,
&min_refresh_rate))
{
g_variant_builder_add (&monitor_properties_builder, "{sv}",
"min-refresh-rate",
g_variant_new_int32 (min_refresh_rate));
}
g_variant_builder_add (&monitors_builder, MONITOR_FORMAT,
monitor_spec->connector,
monitor_spec->vendor,