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 it's enabled and second value whether it's
hardware locked (and so can't be changed hardware locked (and so can't be changed
via gsettings) 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: Possible mode flags:
1 : preferred mode 1 : preferred mode

View File

@ -2073,6 +2073,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
MetaMonitorMode *current_mode; MetaMonitorMode *current_mode;
MetaMonitorMode *preferred_mode; MetaMonitorMode *preferred_mode;
MetaPrivacyScreenState privacy_screen_state; MetaPrivacyScreenState privacy_screen_state;
int min_refresh_rate;
GVariantBuilder modes_builder; GVariantBuilder modes_builder;
GVariantBuilder monitor_properties_builder; GVariantBuilder monitor_properties_builder;
GList *k; GList *k;
@ -2190,6 +2191,14 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
"privacy-screen-state", state); "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, g_variant_builder_add (&monitors_builder, MONITOR_FORMAT,
monitor_spec->connector, monitor_spec->connector,
monitor_spec->vendor, monitor_spec->vendor,