monitor-config-manager: Put finding relevant configs into helper
Finding configurations relevant for inspiration when creating a new one can be useful for finding more things to inherit from previous configurations than the scale, so put the configuration gathering code in a helper. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
This commit is contained in:
parent
0f200efc6d
commit
0f9c9fdc20
@ -802,6 +802,20 @@ find_logical_monitor_config (MetaMonitorsConfig *config,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GList *
|
||||||
|
get_relevant_configs (MetaMonitorConfigManager *config_manager)
|
||||||
|
{
|
||||||
|
GList *configs = NULL;
|
||||||
|
|
||||||
|
if (config_manager->current_config)
|
||||||
|
configs = g_list_append (configs, config_manager->current_config);
|
||||||
|
|
||||||
|
configs = g_list_concat (configs,
|
||||||
|
g_list_copy (config_manager->config_history.head));
|
||||||
|
|
||||||
|
return configs;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
get_last_scale_for_monitor (MetaMonitorConfigManager *config_manager,
|
get_last_scale_for_monitor (MetaMonitorConfigManager *config_manager,
|
||||||
MetaMonitor *monitor,
|
MetaMonitor *monitor,
|
||||||
@ -811,11 +825,7 @@ get_last_scale_for_monitor (MetaMonitorConfigManager *config_manager,
|
|||||||
g_autoptr (GList) configs = NULL;
|
g_autoptr (GList) configs = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
if (config_manager->current_config)
|
configs = get_relevant_configs (config_manager);
|
||||||
configs = g_list_append (configs, config_manager->current_config);
|
|
||||||
|
|
||||||
configs = g_list_concat (configs,
|
|
||||||
g_list_copy (config_manager->config_history.head));
|
|
||||||
|
|
||||||
for (l = configs; l; l = l->next)
|
for (l = configs; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user