Commit dc7798f6 authored by Marco Trevisan's avatar Marco Trevisan 🎺

monitor-manager: Add function to get the maximum scale

This function computes the maximum scaling level for the current setup.
parent 238f3eba
......@@ -371,6 +371,8 @@ gboolean meta_monitor_manager_is_scale_supported (MetaMonitorManager
MetaMonitorMode *monitor_mode,
float scale);
float meta_monitor_manager_get_maximum_scale (MetaMonitorManager *manager);
MetaMonitorManagerCapability
meta_monitor_manager_get_capabilities (MetaMonitorManager *manager);
......
......@@ -191,6 +191,27 @@ meta_monitor_manager_rebuild_logical_monitors (MetaMonitorManager *manager,
primary_logical_monitor);
}
float
meta_monitor_manager_get_maximum_scale (MetaMonitorManager *manager)
{
GList *l;
float scale;
scale = 1.0f;
for (l = manager->monitors; l != NULL; l = l->next)
{
MetaMonitor *monitor = l->data;
MetaOutput *output = meta_monitor_get_main_output (monitor);
MetaCrtc *crtc = meta_output_get_assigned_crtc (output);
if (crtc)
scale = MAX (scale, crtc->scale);
}
return scale;
}
static float
derive_configured_global_scale (MetaMonitorManager *manager,
MetaMonitorsConfig *config)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment