MetaMonitorManager: Add API turning monitor index into logical monitor

This is the current equivalent of looking up the logical monitor in the
logical monitor array using the number, but eventually that will be
deprecated, and before that done differently, so add a temporary helper
for the places that has not been ported yet.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2016-11-29 11:46:41 +08:00
parent 441b854d41
commit e659b07c39
2 changed files with 12 additions and 0 deletions

View File

@ -368,6 +368,9 @@ int meta_monitor_manager_get_num_logical_monitors (MetaMonitorMa
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitors (MetaMonitorManager *manager, MetaLogicalMonitor *meta_monitor_manager_get_logical_monitors (MetaMonitorManager *manager,
unsigned int *n_logical_monitors); unsigned int *n_logical_monitors);
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_number (MetaMonitorManager *manager,
int number);
MetaLogicalMonitor *meta_monitor_manager_get_primary_logical_monitor (MetaMonitorManager *manager); MetaLogicalMonitor *meta_monitor_manager_get_primary_logical_monitor (MetaMonitorManager *manager);
MetaOutput *meta_monitor_manager_get_outputs (MetaMonitorManager *manager, MetaOutput *meta_monitor_manager_get_outputs (MetaMonitorManager *manager,

View File

@ -1314,6 +1314,15 @@ meta_monitor_manager_get_logical_monitors (MetaMonitorManager *manager,
return manager->logical_monitors; return manager->logical_monitors;
} }
MetaLogicalMonitor *
meta_monitor_manager_get_logical_monitor_from_number (MetaMonitorManager *manager,
int number)
{
g_assert (number < (int) manager->n_logical_monitors);
return &manager->logical_monitors[number];
}
MetaLogicalMonitor * MetaLogicalMonitor *
meta_monitor_manager_get_primary_logical_monitor (MetaMonitorManager *manager) meta_monitor_manager_get_primary_logical_monitor (MetaMonitorManager *manager)
{ {