mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
monitor-config-manager: Reject a suggested config with gaps
It could happen that monitors suggest to use coordinates that don't take in consideration the scaling applied to one monitor, and such the generated configuration is not valid because not all the monitors are adjacent. So enforce this check before accepting a suggested configuration as it is. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
This commit is contained in:
parent
58c2f423f7
commit
be9e6dcc4f
@ -904,6 +904,21 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m
|
|||||||
region = g_list_prepend (region, &logical_monitor_config->layout);
|
region = g_list_prepend (region, &logical_monitor_config->layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (l = region; region->next && l; l = l->next)
|
||||||
|
{
|
||||||
|
MetaRectangle *rect = l->data;
|
||||||
|
|
||||||
|
if (!meta_rectangle_is_adjacent_to_any_in_region (region, rect))
|
||||||
|
{
|
||||||
|
g_warning ("Suggested monitor config has monitors with no neighbors, "
|
||||||
|
"rejecting");
|
||||||
|
g_list_free (region);
|
||||||
|
g_list_free_full (logical_monitor_configs,
|
||||||
|
(GDestroyNotify) meta_logical_monitor_config_free);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_list_free (region);
|
g_list_free (region);
|
||||||
|
|
||||||
if (!logical_monitor_configs)
|
if (!logical_monitor_configs)
|
||||||
|
Loading…
Reference in New Issue
Block a user