monitor-manager: Update the monitor mode state before the logical state

This means we can use up to date monitor mode data when generating the
logical state.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-01-20 14:56:34 +08:00
parent 53a93deafc
commit 409c92a68f

View File

@ -1776,6 +1776,10 @@ meta_monitor_manager_update_monitor_modes (MetaMonitorManager *manager,
GList *logical_monitor_configs;
GList *l;
g_list_foreach (manager->monitors,
(GFunc) meta_monitor_set_current_mode,
NULL);
logical_monitor_configs = config ? config->logical_monitor_configs : NULL;
for (l = logical_monitor_configs; l; l = l->next)
{
@ -1783,14 +1787,6 @@ meta_monitor_manager_update_monitor_modes (MetaMonitorManager *manager,
set_logical_monitor_modes (manager, logical_monitor_config);
}
for (l = manager->monitors; l; l = l->next)
{
MetaMonitor *monitor = l->data;
if (!meta_monitor_get_logical_monitor (monitor))
meta_monitor_set_current_mode (monitor, NULL);
}
}
void
@ -1798,7 +1794,6 @@ meta_monitor_manager_update_logical_state (MetaMonitorManager *manager,
MetaMonitorsConfig *config)
{
meta_monitor_manager_rebuild_logical_monitors (manager, config);
meta_monitor_manager_update_monitor_modes (manager, config);
}
void
@ -1807,6 +1802,8 @@ meta_monitor_manager_rebuild (MetaMonitorManager *manager,
{
GList *old_logical_monitors;
meta_monitor_manager_update_monitor_modes (manager, config);
if (manager->in_init)
return;
@ -1836,7 +1833,6 @@ void
meta_monitor_manager_update_logical_state_derived (MetaMonitorManager *manager)
{
meta_monitor_manager_rebuild_logical_monitors_derived (manager);
meta_monitor_manager_update_monitor_modes_derived (manager);
}
void
@ -1844,6 +1840,8 @@ meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager)
{
GList *old_logical_monitors;
meta_monitor_manager_update_monitor_modes_derived (manager);
if (manager->in_init)
return;